/*

There are 2 categories of variables:

- Variables that start with TQ are cleaned variables easily to link to the
questionaire. These variables are ready for analysis.

- Variables that start with TP are auxiliar variables and not to be used for
analysis.

*/

use "$Baseline_dtRaw/surveys/150910_CEIS_BD_Professores_Final.dta", clear

set more off

********************************************************************************
************************************ INTRO *************************************
********************************************************************************
{
drop *_Codes

rename P14_Rec school_id
rename P13_Rec school_name
rename P012 bairro_name
rename ComunaDescricao commune_name
rename Respondent_ID resp_id
rename DataCollection_StartTime time_start
rename DataCollection_FinishTime time_finish
rename JOG_PROF resp_idgame
rename P015 resp_tel
rename P02 resp_name
rename P02_rec resp_name2

gen vil_id = 1 if inlist(school_id,1,	2,	3,	4,	5,	6,	7,	8,	9,	10,	12,	13,	14,	15,	16,	17,	18,	19,	20,	21,	22,	24,	25,	26,	27,	28,	29,	30,	31,	32,	33,	34,	35,	37,	40,	45,	61,	86,	110)
replace vil_id = 2 if inlist(school_id,23,	43,	44,	46,	47,	48,	49,	50,	51,	52,	53,	54,	55,	56,	57,	58,	59,	60,	62,	63,	64,	65,	66,	67,	68,	69,	70,	71,	72,	73,	75,	76,	77,	78,	79,	80,	81)
replace vil_id = 3 if inlist(school_id,11,	36,	38,	39,	41,	42,	74,	82,	83,	84,	85,	87,	88,	89,	90,	91,	92,	93,	94,	95,	96,	97,	98,	99,	101,	102,	103,	104,	105)
replace vil_id = 4 if inlist(school_id,118,	119,	120,	121,	122,	123,	124,	125)
replace vil_id = 5 if inlist(school_id,100,	112,	113,	114,	115,	116,	117)
replace vil_id = 6 if inlist(school_id,109,	111)
replace vil_id = 7 if inlist(school_id,106,	107)
replace vil_id = 8 if inlist(school_id,126)
replace vil_id = 9 if inlist(school_id,108)

lab def vil 1 "Sumbe" 2 "Porto Amboim" 3	"Gabela" 4	"Conda" 5	"Ebo" 6	"Quilenda" 7	"Seles" 8	"Cassongue" 9	"Quibala"
lab val vil_id vil

lab var school_id 			"ID number school"
lab var school_name 		"Name school"
lab var vil_id 				"ID number village, value label includes names"
lab var commune_name 		"Name commune"
lab var bairro_name 		"Name neighbourhood"
lab var resp_id 			"ID number respondent"
lab var resp_name 			"Name main respondent"
lab var resp_idgame			"ID number respondent games (teacher)"
lab var resp_tel 			"Phone number main respondent"
lab var time_start 			"What time did the interview start?"
lab var time_finish 		"What time did the interview end?"

lab var P031 "Teacher of preschool"
lab var P032 "Teacher of grade 1"
lab var P033 "Teacher of grade 2"
lab var P034 "Teacher of grade 3"
lab var P035 "Teacher of grade 4"
lab var P036 "Teacher of grade 5"
lab var P037 "Teacher of grade 6"

rename P031 preschool
rename P032 grade1
rename P033 grade2
rename P034 grade3
rename P035 grade4
rename P036 grade5
rename P037 grade6

drop P0 P013 P014 ProvinciaDescricao MunicipioDescricao
order resp_id time_start time_finish school_id school_name resp_name resp_name2 resp_idgame resp_tel vil_id commune_name bairro_name preschool grade1 grade2 grade3 grade4 grade5 grade6
}
********************************************************************************
********************************** SECTION 1 ***********************************
********************************************************************************
{
lab var P1 			"Age respondent"
lab var P2 			"Respondent is female"
lab var P3 			"Current home neighbourhood relative to the school"
lab var P3_C2		"Name current home neighbourhood if in other community/neighborhood of the commune where the school is located"
lab var P3_C3		"Name current home neighbourhood if in the centre of the municipality where the school is located"
lab var P3_C4		"Name current home neighbourhood if outside the municipality where the school is located"
lab var P4 			"Birthplace municipality"
lab var P5 			"Neighbourhood the respondent grew up in relative to the school"
lab var P5_C2		"Name neighbourhood the respondent grew up in if in other community/neighborhood of the commune where the school is located"
lab var P5_C3		"Name neighbourhood the respondent grew up in if in the centre of the municipality where the school is located"
lab var P5_C4		"Name neighbourhood the respondent grew up in if outside the municipality where the school is located"
lab var P6 			"Time of leaving birthplace"
lab var P7 			"Time of arriving current hometown"
lab var P8 			"Highest level of education enjoyed by respondent"
lab var P9 			"Marital status"
lab var P10 		"Highest level of education enjoyed by partner"
lab var P11 		"Ocupation partner"
lab var P12 		"Monthly total home income"
lab var P13 		"How many of your children live in this (your) home?"
lab var P14 		"How many children live in this (your) home but are not your children?"
lab var P15 		"How many of the children who live in your house are girls?"
lab var P16 		"How many of the children living in this (your) home attend this elementary school?"
lab var P17_1_Q 	"(1) School year of child that lives with respondent"
lab var P17_2_Q 	"(2) School year of child that lives with respondent"
lab var P17_3_Q 	"(3) School year of child that lives with respondent"
lab var P17_4_Q 	"(4) School year of child that lives with respondent"
lab var P17_5_Q 	"(5) School year of child that lives with respondent"
lab var P17_6_Q 	"(6) School year of child that lives with respondent"
lab var P17_7_Q 	"(7) School year of child that lives with respondent"
lab var P17_8_Q 	"(8) School year of child that lives with respondent"
lab var P18 		"Language spoken at home"
lab var P19 		"Type of home in terms of ownership"
lab var P20 		"Aproximate distance in km between home and school"
lab var P21 		"Method of transportation used between home and school"
lab var P22 		"Time in minutes spend between home and school"

drop P17_9_Q P17_10_Q P17_11_Q P17_12_Q P17_13_Q P17_14_Q P17_15_Q P17_16_Q P17_17_Q P17_18_Q P17_19_Q P17_20_Q

#delimit;
lab def dummy
1	"Yes"
0	"No"
;
lab def wrtschool
1 "This community/neighborhood where we are"
2 "Another community/neighborhood of the commune (1)"
3 "At the centre of the municipality (2)"
4 "Out of town (3)"
;
lab def maritalstatus
1 "Married"
2 "De facto union"
3 "Single"
4 "Widowed"
5 "Divorced/separated"
;
lab def edu1
1 "None"
2 "First grade"
3 "First level (former elementary school)"
4 "Second level (old high school, 5th and 6th grade)"
5 "Third level (former preparatory school, 7th and 8th grades)"
6 "High school (9th to 12th grade)"
7 "Professional technical education (2-4 years)"
8 "University - Angola"
9 "University - abroad"
10 "Post-graduation - Angola"
11 "Graduate - abroad"
;
lab def ocu
1 "Part-time salaried employment in the private sector"
2 "Part-time salaried employment in the public sector"
3 "Full-time salaried employment in the private sector"
4 "Full-time salaried employment in the public sector"
5 "Self-employment (does not employ other persons)"
6 "Owner of a business (employs other people)"
7 "Peasants (subsistence agriculture)"
8 "Farmer (employs others)"
9 "Retired"
10 "Student (still in school)"
11 "Domestic worker/housekeeper"
12 "Unemployed"
13 "Religious figure"
14 "Politician"
;
lab def income
1	"É <= 1 000 Cuanzas/mês."
2	"1 001 – 4 000 Cuanzas/mês."
3	"4 001 – 10 000 Cuanzas/mês."
4	"10 001 – 20 000 Cuanzas/mês."
5	"20 001 – 30 000 Cuanzas/mês."
6	"30 001 – 40 000 Cuanzas/mês."
7	"40 001 => É Cuanzas/mês."
;
lab def language
1	"Portuguese"
2	"Umbundu"
3	"Kimbundu"
4	"Kicongo"
5	"Ngoia"
;
lab def home
1 "Own home"
2 "Rented home"
3 "Accommodation made available by community or family"
4 "Accommodation made available by state"
;
lab def transport
1 "Walking"
2 "Bicycle"
3 "Candongueiro/taxi"
4 "Car"
5 "Motor bike"
6 "Hitchhiking"
;
#delimit cr

rename P1 Q1_01

rename P2 Q1_02
recode Q1_02 (1=0) (2=1)
lab val Q1_02 dummy

rename P3 Q1_03
lab val Q1_03 wrtschool
rename P3_C2 Q1_03_01
rename P3_C3 Q1_03_02
rename P3_C4 Q1_03_03

rename P4 Q1_04

rename P5 Q1_05
rename P5_C2 Q1_05_01
rename P5_C3 Q1_05_02
rename P5_C4 Q1_05_03
lab val Q1_05 wrtschool

rename P6 Q1_06
rename P7 Q1_07
rename P8 Q1_08
lab val Q1_08 edu1
rename P9 Q1_09
lab val Q1_09 maritalstatus
rename P10 Q1_10
lab val Q1_10 edu1

rename P11 Q1_11
recode Q1_11 (8=9) (9=10) (10=11) (11=12) (12=.)
replace Q1_11 = 1 if P11_C13=="FARMACEUTICA"
replace Q1_11 = 2 if P11_C13=="professor"
replace Q1_11 = 2 if P11_C13=="soldador"
replace Q1_11 = 2 if P11_C13=="militar"
replace Q1_11 = 2 if P11_C13=="alfandegas"
replace Q1_11 = 1 if P11_C13=="MOTORISTA"
replace Q1_11 = 5 if P11_C13=="elecrtrecista"
replace Q1_11 = 1 if P11_C13=="motorista"
replace Q1_11 = 5 if P11_C13=="serralheiro"
replace Q1_11 = 13 if P11_C13=="MICIONÁRIO"
lab val Q1_11 ocu
lab var P11_C13 "AUX"

rename P12 Q1_12
lab val Q1_12 income

rename P13 Q1_13
rename P14 Q1_14
rename P15 Q1_15
rename P16 Q1_16
rename P17_1_Q Q1_17_01
rename P17_2_Q Q1_17_02
rename P17_3_Q Q1_17_03
rename P17_4_Q Q1_17_04
rename P17_5_Q Q1_17_05
rename P17_6_Q Q1_17_06
rename P17_7_Q Q1_17_07
rename P17_8_Q Q1_17_08

rename P18 Q1_18
lab val Q1_18 language
drop P18_C6

rename P19 Q1_19
lab val Q1_19 home
replace Q1_19 = . if Q1_19==4
replace Q1_19 = 3 if P19_C4=="dos pais"
replace Q1_19 = 4 if P19_C4=="ofertada pelo estado"
lab var P19_C4 "AUX"

rename P20 Q1_20

rename P21 Q1_21
lab val Q1_21 transport
replace Q1_21 = . if Q1_21==6
replace Q1_21 = 4 if P21_C6=="carro proprio"
replace Q1_21 = 5 if P21_C6=="MOTA"
replace Q1_21 = 5 if P21_C6=="MOTOTAXI"
replace Q1_21 = 6 if P21_C6=="baleia"
replace Q1_21 = 6 if P21_C6=="boleia"
replace Q1_21 = 6 if P21_C6=="taxi ou boleia"
lab var P21_C6 "AUX"

rename P22 Q1_22
replace Q1_22 ="30" if Q1_22=="hora e 30m"
replace Q1_22 ="8" if Q1_22=="8 min"
replace Q1_22 ="360" if Q1_22=="6HORAS"
replace Q1_22 ="360" if Q1_22=="6H"
replace Q1_22 ="60" if Q1_22=="60MIN"
replace Q1_22 ="60" if Q1_22=="60M"
replace Q1_22 ="5" if Q1_22=="5minutos"
replace Q1_22 ="300" if Q1_22=="5horas"
replace Q1_22 ="300" if Q1_22=="5H"
replace Q1_22 ="50" if Q1_22=="50MIN"
replace Q1_22 ="240" if Q1_22=="4H"
replace Q1_22 ="47" if Q1_22=="47minutos"
replace Q1_22 ="45" if Q1_22=="45minutos"
replace Q1_22 ="45" if Q1_22=="45min"
replace Q1_22 ="45" if Q1_22=="45m"
replace Q1_22 ="40" if Q1_22=="40minutos"
replace Q1_22 ="40" if Q1_22=="40MIN"
replace Q1_22 ="40" if Q1_22=="40M"
replace Q1_22 ="40" if Q1_22=="40 minutos"
replace Q1_22 ="180" if Q1_22=="3horas"
replace Q1_22 ="180" if Q1_22=="3H"
replace Q1_22 ="35" if Q1_22=="35minutos"
replace Q1_22 ="30" if Q1_22=="30minutos"
replace Q1_22 ="30" if Q1_22=="30MIN"
replace Q1_22 ="30" if Q1_22=="30M"
replace Q1_22 ="30" if Q1_22=="30 min"
replace Q1_22 ="120" if Q1_22=="2horas"
replace Q1_22 ="120" if Q1_22=="2h"
replace Q1_22 ="25" if Q1_22=="25minutos"
replace Q1_22 ="23" if Q1_22=="23minutos"
replace Q1_22 ="20" if Q1_22=="20minutos"
replace Q1_22 ="20" if Q1_22=="20M"
replace Q1_22 ="20" if Q1_22=="20 m"
replace Q1_22 ="60" if Q1_22=="1hora"
replace Q1_22 ="60" if Q1_22=="1H"
replace Q1_22 ="15" if Q1_22=="15minutos"
replace Q1_22 ="15" if Q1_22=="15MIN"
replace Q1_22 ="15" if Q1_22=="15 minuto"
replace Q1_22 ="10" if Q1_22=="10minutos"
replace Q1_22 ="10" if Q1_22=="10MIN"
replace Q1_22 ="10" if Q1_22=="10MIM"
replace Q1_22 ="10" if Q1_22=="10m"
replace Q1_22 ="2" if Q1_22=="1.30M"
replace Q1_22 ="2" if Q1_22=="1.30"
replace Q1_22 ="60" if Q1_22=="1 hora"
replace Q1_22 ="2" if Q1_22=="1:30"
replace Q1_22 ="10" if Q1_22=="-10"
replace Q1_22 ="60" if Q1_22=="60min"
replace Q1_22 ="60" if Q1_22=="1HORA"
replace Q1_22 ="10" if Q1_22=="10min"
replace Q1_22 ="120" if Q1_22=="2H"
destring Q1_22, replace

order P11_C13 P19_C4 P21_C6, after(Q1_22)
}
********************************************************************************
********************************** SECTION 2 ***********************************
********************************************************************************
{
lab var P2_1 "What is your position in the school?"
lab var P2_2 "Did you take any teacher qualification exam after 5 or 10 years of service?"
lab var P2_1_C6 "AUX"
rename P2_1 Q2_01
rename P2_2 Q2_02
recode Q2_01 (6=4)

#delimit;
lab def Q2_01
1 "Director of the school"
2 "Deputy director of the school"
3 "Senior teacher"
4 "Teacher"
5 "Teacher in training"
;
lab def Q2_02
1 "Yes, either after 5 or after 10 years"
2 "Yes, after 5 years"
3 "Not yet"
4 "No, I've never been obliged"
;
#delimit cr

lab val Q2_01 Q2_01
lab val Q2_02 Q2_02

lab var P2_31 	"Did not participate in any professional development activity since february 2012"
lab var P2_32 	"Did management training since february 2012"
lab var P2_33 	"Did university course about teaching since february 2012"
lab var P2_34 	"Visited other schools to observe since february 2012"
lab var P2_35 	"Received other directors and/or province representatives since february 2012"
lab var P2_36 	"Participated in a professor network since february 2012"
lab var P2_37 	"Participated in a workshop and/or conference since february 2012"
lab var P2_38 	"AUX"
lab var P2_3_C8 "AUX"

replace P2_37 = 1 if P2_3_C8=="ciminario"
replace P2_37 = 1 if P2_3_C8=="capacitação de formação de professor de amigas de crianças"
replace P2_37 = 1 if P2_3_C8=="Seminário de capacitação"
replace P2_37 = 1 if P2_3_C8=="siminario"
replace P2_37 = 1 if P2_3_C8=="capacitação de professores para o ensino primario."
replace P2_37 = 1 if P2_3_C8=="desenvolvimento de capacitaçao na disciplina de lingua portuguesa e matematica"
replace P2_37 = 1 if P2_3_C8=="siminario dos professores"
replace P2_37 = 1 if P2_3_C8=="SEMINARIO DE CAPACITACAO"

rename P2_31 Q2_03_01
rename P2_32 Q2_03_02
rename P2_33 Q2_03_03
rename P2_34 Q2_03_04
rename P2_35 Q2_03_05
rename P2_36 Q2_03_06
rename P2_37 Q2_03_07

lab val Q2_03_* dummy

lab var P2_4 "How many years ago did you teach when you came to this school?"
rename P2_4 Q2_04

lab var P2_5 "School where respondent was previously teacher?"
replace P2_5 = "" if P2_5=="0"
rename P2_5 Q2_05

lab var P2_6 "Neighborhood of school where respondent was previously teacher"
replace P2_6 = "" if P2_6=="0"
rename P2_6 Q2_06

lab var P2_7 "Village of school where respondent was previously teacher"
replace P2_7 = "" if P2_7=="0"
rename P2_7 Q2_07

#delimit ;
lab def Q2_08
1	"Transfer by the ministry"
2	"Did not like the location"
3	"Did not get along well with other professors"
4	"Did not get along well with director of the school"
5	"Did not get along well with parents"
6	"Personal reasons"
7	"Missing conditions for transport and/or housing (distance)"
8	"Automatic rotation"
9	"Transfer by village/local coordenation"
10	"Studies"
11	"Health"
12	"Armed conflict"
13	"Other"
;
#delimit cr

lab var P2_8 "Reason for leaving previous school"
rename P2_8 Q2_08
lab val Q2_08 Q2_08
replace Q2_08 = . if Q2_08==8
replace Q2_08=7 if P2_8_C8=="a distancia"
replace Q2_08=7 if P2_8_C8=="DIFICULDADE DE TRANSPORTE"
replace Q2_08=7 if P2_8_C8=="distancia"
replace Q2_08=7 if P2_8_C8=="por causa da destancia"
replace Q2_08=7 if P2_8_C8=="SAI DELA PORQUE TINHA DIICULDADES EM ME DESLOCAR PARA LA, PRICIPALMENTE EPOCA CHUVOSA"
replace Q2_08=8 if P2_8_C8=="rotação dos professores, estava como suplente na antiga escola e foi enviado para esta escola"
replace Q2_08=8 if P2_8_C8=="rotaçao dos professores"
replace Q2_08=8 if P2_8_C8=="rotatividade"
replace Q2_08=8 if P2_8_C8=="rotatividade dos professores"
replace Q2_08=8 if P2_8_C8=="TROCA COM O COLEGA"
replace Q2_08=8 if P2_8_C8=="TROCA DE ESPERIENCIA"
replace Q2_08=8 if P2_8_C8=="TROCA DE PROFESSORES"
replace Q2_08=9 if P2_8_C8=="TRASFERIDO PEKA CORDENAÇAO COMUNAL DA GANGULS"
replace Q2_08=10 if P2_8_C8=="AUMENTAR OS ESTUDO"
replace Q2_08=10 if P2_8_C8=="bolsa de estudo"
replace Q2_08=10 if P2_8_C8=="estudo"
replace Q2_08=10 if P2_8_C8=="FORMACAO ACADEMICA"
replace Q2_08=10 if P2_8_C8=="MUTIVO DE ESTUDO"
replace Q2_08=10 if P2_8_C8=="para dar continuidade aos estudos"
replace Q2_08=10 if P2_8_C8=="POR MOTIVO DE FORMAÇAO"
replace Q2_08=10 if P2_8_C8=="Por motivos de continuação de estudos"
replace Q2_08=11 if P2_8_C8=="doença"
replace Q2_08=11 if P2_8_C8=="mutivos de saude"
replace Q2_08=11 if P2_8_C8=="por motivos de doenças"
replace Q2_08=11 if P2_8_C8=="POR QUESTOES DE SAUDE FOI OBRIGADO A SER TRANSFERIDO PELO MUNICIPIO DO SUMBE"
replace Q2_08=11 if P2_8_C8=="saude"
replace Q2_08=12 if P2_8_C8=="DEVIDO A GUERRA"
replace Q2_08=12 if P2_8_C8=="GUERRA"
replace Q2_08=12 if P2_8_C8=="PORCAUSA DOS CONFLITOS ARMADO"

lab var P2_8_C8 "AUX"

lab var P2_9 "Years teaching at this school"
rename P2_9 Q2_09

lab var P2_10 "Someone helped you to become nominated as teacher of this school?"
rename P2_10 Q2_10
recode Q2_10 (2=0)
lab val Q2_10 dummy

lab var P2_11 "Who helped you to become nominated as teacher of this school"
rename P2_11 Q2_11
replace Q2_11 = . if Q2_11==7
replace Q2_11 = 6 if P2_11_C7=="Alguem da respsrtição municipal"
replace Q2_11 = 7 if P2_11_C7=="Afamilia"
replace Q2_11 = 7 if P2_11_C7=="Familia"
replace Q2_11 = 7 if P2_11_C7=="Marido"
replace Q2_11 = 7 if P2_11_C7=="O esposo"
replace Q2_11 = 7 if P2_11_C7=="esposo"
replace Q2_11 = 7 if P2_11_C7=="meu esposo"
replace Q2_11 = 7 if P2_11_C7=="meu xpozo"
replace Q2_11 = 7 if P2_11_C7=="spozo"
replace Q2_11 = 8 if P2_11_C7=="CORDENADOR COMUNAL"

#delimit
lab def Q2_11
1	"Someone of the ministry of education"
2	"Someone of the provincial directory of education"
3	"Director of the school"
4	"Political party"
5	"A known professor of the school"
6	"Someone of the municipality administration"
7	"Family/husband"
8	"Area/commune coordenator"
;
#delimit cr
lab val Q2_11 Q2_11
lab var P2_11_C7 "AUX"

lab var P2_12 "How long do you intend to continue teaching?"
rename P2_12 Q2_12
replace Q2_12=. if Q2_12==6
replace Q2_12 = 1 if P2_12_C6=="nao poder mais"
replace Q2_12 = 1 if P2_12_C6=="ate poder"
replace Q2_12 = 1 if P2_12_C6=="ate q amorte o separa"
replace Q2_12 = 1 if P2_12_C6=="PARA SEMPRE"
replace Q2_12 = 4 if P2_12_C6=="pretendo para toda vida mais nessa ecola não"
replace Q2_12 = 5 if P2_12_C6=="de momento nao sei"
replace Q2_12 = 6 if P2_12_C6=="até o final do corrente ano lectivo"
#delimit ;
;
lab def Q2_12
1	"Until I can"
2	"Until I get authorized"
3	"Until you reach retirement age"
4	"It will probably continue unless something better appears"
5	"Undecided at this point"
6	"Less than 3 years"
;
lab val Q2_12 Q2_12;
#delimit cr

lab var P2_12_C6 "AUX"

rename P2_13 Q2_13
replace Q2_13 = . if Q2_13==0
replace Q2_13 = Q2_13*1000 if Q2_13<300
lab var Q2_13 "Monthly salary after tax"

rename P2_14 Q2_14
recode Q2_14 (2=0) (3=.)
lab val Q2_14 dummy
lab var Q2_14 "Is it possible for a director to receive a performance based bonus?"

rename P2_15 Q2_15
recode Q2_15 (2=0)
lab val Q2_15 dummy
lab var Q2_15 "Received bonus since february 2012"

rename P2_160(#) Q2_16_0(#)

forval n=1/9{
replace Q2_16_0`n' = . if P2_1611==1
}

replace Q2_16_02 =1 if P2_16_C10=="com rendimento e aproveitamento das crianças"
replace Q2_16_02 =1 if P2_16_C10=="pelos resultados"
replace Q2_16_04 =1 if P2_16_C10=="atraves da pntualidade"
replace Q2_16_04 =1 if P2_16_C10=="atraves de uma avaliação final quanto a pontualidade"
replace Q2_16_04 =1 if P2_16_C10=="pontualidade"
replace Q2_16_04 =1 if P2_16_C10=="pontualidade e assuidade"
replace Q2_16_07 =1 if P2_16_C10=="pelo nivel de assimilaçao dos alunos"
replace Q2_16_09 =1 if P2_16_C10=="acompanhamento do professor"
replace Q2_16_09 =1 if P2_16_C10=="AVALIAÇAO DO EMPENHO  ANUAL DO EMENHO DE CADA PROFESSOR"
replace Q2_16_09 =1 if P2_16_C10=="avaliaçao do comportamento"
replace Q2_16_09 =1 if P2_16_C10=="com base na estatistica elaborada pelo director."
replace Q2_16_09 =1 if P2_16_C10=="como ela transmite aos alunos"
replace Q2_16_09 =1 if P2_16_C10=="como os alunos lidam com o professor"
replace Q2_16_09 =1 if P2_16_C10=="Comportamento apreciado da sociedade, boa relação com os colegas, apresentação e compustura"
replace Q2_16_09 =1 if P2_16_C10=="das obeservações das aulas pelos fiscais"
replace Q2_16_09 =1 if P2_16_C10=="e o desempenho do professor"
replace Q2_16_09 =1 if P2_16_C10=="O DESEMPENHO E MEDIDO MEDIANTE AS AVALHAÇOES ANUAIS FEIAS COMISSAO DA DIREÇAO DE ESCOLA"

lab var Q2_16_01 "Performance of the teachers is not measured"
lab var Q2_16_02 "Performance of the teachers is measured through final results students"
lab var Q2_16_03 "Performance of the teachers is measured through level of preparation (lesson plans)"
lab var Q2_16_04 "Performance of the teachers is measured through assiduity"
lab var Q2_16_05 "Performance of the teachers is measured through standardized test results students"
lab var Q2_16_06 "Performance of the teachers is measured through the organization of classes"
lab var Q2_16_07 "Performance of the teachers is measured through the assiduity of students"
lab var Q2_16_08 "Performance of the teachers is measured through the satisfaction of parents"
lab var Q2_16_09 "Performance of the teachers is measured through subjective assessment by a senior teacher/director"

lab var P2_1610 "AUX"
lab var P2_1611 "AUX"
lab var P2_16_C10 "AUX"

rename P2_17 Q2_17
replace Q2_17 = . if Q2_17==7
replace Q2_17=3 if P2_17_C7=="COLETIVO DA DIREÇAO DA ESCOLA"
replace Q2_17=4 if P2_17_C7=="CORDENADOR DE ZONA"
replace Q2_17=6 if P2_17_C7=="coletivos alguns colegas"
replace Q2_17=6 if P2_17_C7=="comissaçao de avaliaçao"
replace Q2_17=6 if P2_17_C7=="comissao de avaliçao"
replace Q2_17=6 if P2_17_C7=="CORDENADOR DE DISCIPLINA"
replace Q2_17=6 if P2_17_C7=="GRUPOS DE ALGUNS PROFESSORES"
replace Q2_17=6 if P2_17_C7=="MEMBRO DE CONSELHO DA ESCOLA"
replace Q2_17=6 if P2_17_C7=="o colitivo de avaliaçao"
replace Q2_17=6 if P2_17_C7=="seleciona se uns colegas"
replace Q2_17=6 if P2_17_C7=="uma comissaçao"
replace Q2_17=6 if P2_17_C7=="UMA COMISSAAO SELECIONDA PELO DIREITOR"

lab var P2_17_C7 "AUX"
lab var Q2_17 "Responsible for evaluation of teacher"
#delimit ;
;
lab def Q2_17
1	"Director of the school"
2	"Deputy director of the school"
3	"School direction"
4	"Direction of province/vilage/commune"
5	"Ministry of education"
6	"Task force (independent committee)"
;
lab val Q2_17 Q2_17;
#delimit cr

rename P2_20 Q2_20
recode Q2_20 (2=0) (3=.)
lab val Q2_20 dummy
lab var Q2_20 "Can the school director dismiss you if he/she wants to?"


rename P2_181 Q2_18_01
rename P2_182 Q2_18_02
rename P2_183 Q2_18_03
rename P2_184 Q2_18_04
rename P2_185 Q2_18_05

rename P2_191 Q2_19_01
rename P2_192 Q2_19_02
rename P2_193 Q2_19_03
rename P2_194 Q2_19_04

forval n=1/5{
replace Q2_18_0`n' = . if P2_187==1
}
replace P2_186 = . if P2_187==1
replace P2_186 = . if Q2_18_01==1

gen Q2_18_06 = 0 if Q2_18_01==0
order Q2_18_06, after(Q2_18_05)

forval n=1/4{
replace Q2_19_0`n' = . if P2_196==1
}
replace P2_195 = . if P2_196==1
replace P2_195 = . if Q2_19_01==1

gen Q2_19_05 = 0 if Q2_19_01==0
order Q2_19_05, after(Q2_19_04)

lab var Q2_18_01 "Consequence of good performance: Nothing happens"
lab var Q2_18_02 "Consequence of good performance: Financial bonus"
lab var Q2_18_03 "Consequence of good performance: “Medal” or something similar"
lab var Q2_18_04 "Consequence of good performance: Promotion to better position"
lab var Q2_18_05 "Consequence of good performance: Transfer to better school"
lab var Q2_18_06 "Consequence of good performance: Oral and/or written notification"

lab var Q2_19_01 "Consequence of bad performance: Nothing happens"
lab var Q2_19_02 "Consequence of bad performance: Financial penalty"
lab var Q2_19_03 "Consequence of bad performance: Transfer"
lab var Q2_19_04 "Consequence of bad performance: Dismissal"
lab var Q2_19_05 "Consequence of bad performance: Oral and/or written notification"

replace Q2_18_01= 1 if P2_18_C6=="nada"
replace Q2_18_01= 1 if P2_18_C6=="nada aconteçe"
replace Q2_18_01= 1 if P2_18_C6=="nada muda"

replace Q2_18_02= 1 if P2_18_C6=="CREDITO BANCARIO"
replace Q2_18_02= 1 if P2_18_C6=="NESTE CASO TEM APOSSIBILIDADE DE FAZER CREDITO"
replace Q2_18_02= 1 if P2_18_C6=="premio"

replace Q2_18_04= 1 if P2_18_C6=="chance de promoçao"
replace Q2_18_04= 1 if P2_18_C6=="promoçao"

replace Q2_18_06= 1 if P2_18_C6=="É AVALIADA DE UMA FORMA POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="É AVALIADO COM UMA NOTA BOM"
replace Q2_18_06= 1 if P2_18_C6=="É AVALIADO NA FIXA COMO BOM PROFESSOR"
replace Q2_18_06= 1 if P2_18_C6=="È INCENTIVADO  PARA CONTINUAR E NAO DESISTIR"
replace Q2_18_06= 1 if P2_18_C6=="a sua avaliaçao e bom ou muito bom"
replace Q2_18_06= 1 if P2_18_C6=="AFICHADEAVALIAÇAO È BOA"
replace Q2_18_06= 1 if P2_18_C6=="AGRADECIMENTO"
replace Q2_18_06= 1 if P2_18_C6=="AGRADECIMENTOS VERBAIS"
replace Q2_18_06= 1 if P2_18_C6=="agredsimento"
replace Q2_18_06= 1 if P2_18_C6=="alegria"
replace Q2_18_06= 1 if P2_18_C6=="avalia e positivo"
replace Q2_18_06= 1 if P2_18_C6=="AVALIAÇAO É BOA"
replace Q2_18_06= 1 if P2_18_C6=="AVALIAÇAO È POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="AVALIAÇAO BOA"
replace Q2_18_06= 1 if P2_18_C6=="AVALIAÇAO E POSITIVAA"
replace Q2_18_06= 1 if P2_18_C6=="AVALIAÇAO POSITIVA NO FINAL DO LECTIVO"
replace Q2_18_06= 1 if P2_18_C6=="avaliaçao è boa"
replace Q2_18_06= 1 if P2_18_C6=="avaliçao positiva"
replace Q2_18_06= 1 if P2_18_C6=="AVALUAÇAO É BOM"
replace Q2_18_06= 1 if P2_18_C6=="boa avaliaçao"
replace Q2_18_06= 1 if P2_18_C6=="boa avaliçao"
replace Q2_18_06= 1 if P2_18_C6=="BOA AVLIÇAO"
replace Q2_18_06= 1 if P2_18_C6=="BOA CLASSIFICAÇÃO"
replace Q2_18_06= 1 if P2_18_C6=="BOA CLASSIFICAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="boa classificaçao"
replace Q2_18_06= 1 if P2_18_C6=="boa qualificaçao"
replace Q2_18_06= 1 if P2_18_C6=="bom"
replace Q2_18_06= 1 if P2_18_C6=="CLASSIFICAÇ¬O BOM"
replace Q2_18_06= 1 if P2_18_C6=="COLOCAR NA FICHA DE AVALIAÇAO BOM"
replace Q2_18_06= 1 if P2_18_C6=="diploma demerito"
replace Q2_18_06= 1 if P2_18_C6=="e positivo"
replace Q2_18_06= 1 if P2_18_C6=="e satisfatoria"
replace Q2_18_06= 1 if P2_18_C6=="elogio"
replace Q2_18_06= 1 if P2_18_C6=="ELOGIOS"
replace Q2_18_06= 1 if P2_18_C6=="elogiu"
replace Q2_18_06= 1 if P2_18_C6=="EM A FICHA AVALIATIVA BOA"
replace Q2_18_06= 1 if P2_18_C6=="encorajamento"
replace Q2_18_06= 1 if P2_18_C6=="EOGIADA"
replace Q2_18_06= 1 if P2_18_C6=="FICHA DE AVALIACAO"
replace Q2_18_06= 1 if P2_18_C6=="gratificaçao pelo dertor"
replace Q2_18_06= 1 if P2_18_C6=="ha mais gratificaçao"
replace Q2_18_06= 1 if P2_18_C6=="LEVA BOM NA FICHA DE AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="levas um bom"
replace Q2_18_06= 1 if P2_18_C6=="MELHOR AVAKIAÇAO NOFINAL DE ANO"
replace Q2_18_06= 1 if P2_18_C6=="MELHOR NOTA NA AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="NA AVALIAÇAO É COLOCADO BOM"
replace Q2_18_06= 1 if P2_18_C6=="NA FICHA DE AVALUAÇAO LEVO BOM"
replace Q2_18_06= 1 if P2_18_C6=="na fixa tens um bom resultado"
replace Q2_18_06= 1 if P2_18_C6=="NOTA BOA"
replace Q2_18_06= 1 if P2_18_C6=="QUADRO DE HONRRA"
replace Q2_18_06= 1 if P2_18_C6=="RECEBE ELOGIO"
replace Q2_18_06= 1 if P2_18_C6=="RECEBE UMA BOA AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="recebo elogio"
replace Q2_18_06= 1 if P2_18_C6=="rendimento"
replace Q2_18_06= 1 if P2_18_C6=="RESULTADO POSITIVO NAS AVALIAÇOES"
replace Q2_18_06= 1 if P2_18_C6=="resultato positivo"
replace Q2_18_06= 1 if P2_18_C6=="S” ELOGIO AVALIAÇAO BOM"
replace Q2_18_06= 1 if P2_18_C6=="SE EU TUVER UM BOM DESEMPENHO TENHI UM BOM NA FICHA DE AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="SE O PROFESSOR TIVER UM BOM DESEMPENHO È ATRIBUIDO UMA NOTA MAXIMA NA FICHA DE AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="se tiver um bom desempenho  tem comoavaliaçao muito bom"
replace Q2_18_06= 1 if P2_18_C6=="SER ELOGIADO"
replace Q2_18_06= 1 if P2_18_C6=="SOU AVALIADA NEGATIVAMENTE"
replace Q2_18_06= 1 if P2_18_C6=="SOU AVALIADA PISITIVAMENTE"
replace Q2_18_06= 1 if P2_18_C6=="SOU AVALIADA POSITIVAMENTE"
replace Q2_18_06= 1 if P2_18_C6=="SOU AVALIADO POSITIVAMEMTE"
replace Q2_18_06= 1 if P2_18_C6=="SOU AVSLUADO COM BOA NOTA"
replace Q2_18_06= 1 if P2_18_C6=="SOU ELOGIADO"
replace Q2_18_06= 1 if P2_18_C6=="sufixi"
replace Q2_18_06= 1 if P2_18_C6=="TEM AVALIAÇAO POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="TEM BOM NA FICHADE AVALUAÇAI"
replace Q2_18_06= 1 if P2_18_C6=="tem como fixa de avalia çao positiva"
replace Q2_18_06= 1 if P2_18_C6=="tem na ficha de avaliçao bom"
replace Q2_18_06= 1 if P2_18_C6=="TEM UM BON RESULTADO NO FINAL DE ANO"
replace Q2_18_06= 1 if P2_18_C6=="TEM UMA BOA PONTUAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="TEM UMA CLASSIFIÇAO POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="TEM UMA VALI ÇAO POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="tem uma valiaçao e leva um bom"
replace Q2_18_06= 1 if P2_18_C6=="TEMUA NOTA POSITIVA NAFICHA DE AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="tenhem dado um premio que não é de valor monetario"
replace Q2_18_06= 1 if P2_18_C6=="tenho a qualifica çao de muiro bom"
replace Q2_18_06= 1 if P2_18_C6=="TENHO AVALIAÇAO POSITUVA"
replace Q2_18_06= 1 if P2_18_C6=="tenho nota positiva na fixa de avaliaçao"
replace Q2_18_06= 1 if P2_18_C6=="TENHO Q CLASSIFICAÇAO BOM"
replace Q2_18_06= 1 if P2_18_C6=="tenho q ser chamado e me aconselhar"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA AVALIAÇAO BOM OU MUITO BOM"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA AVALIAÇAO MUITO BOM"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA AVALIAÇAO POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA BOA AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA BOA AVALIAÇAO NO FINAL"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA BOA CLASSIFICAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="TENHO UMA NOTA BOA NA FICHA DE AVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="tens um bom"
replace Q2_18_06= 1 if P2_18_C6=="ter bom"
replace Q2_18_06= 1 if P2_18_C6=="ter um bom"
replace Q2_18_06= 1 if P2_18_C6=="TEREI AVALIAÇAO É  POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="terei bom"
replace Q2_18_06= 1 if P2_18_C6=="TEREI NOTA BOA NOTA"
replace Q2_18_06= 1 if P2_18_C6=="TEREI UMA AVALIAÇAO POSITIVA"
replace Q2_18_06= 1 if P2_18_C6=="um alto estima"
replace Q2_18_06= 1 if P2_18_C6=="um bom"
replace Q2_18_06= 1 if P2_18_C6=="um bom na ficha"
replace Q2_18_06= 1 if P2_18_C6=="um bom redimento"
replace Q2_18_06= 1 if P2_18_C6=="um bom redimento na avaliaçao"
replace Q2_18_06= 1 if P2_18_C6=="um bom resultado"
replace Q2_18_06= 1 if P2_18_C6=="um merito"
replace Q2_18_06= 1 if P2_18_C6=="um profissional"
replace Q2_18_06= 1 if P2_18_C6=="um sufixi"
replace Q2_18_06= 1 if P2_18_C6=="uma avaliaçao positiva"
replace Q2_18_06= 1 if P2_18_C6=="uma bom"
replace Q2_18_06= 1 if P2_18_C6=="uma classificaçao positiva na fixa de avaliaçao"
replace Q2_18_06= 1 if P2_18_C6=="UMABBOA WVALIAÇAO"
replace Q2_18_06= 1 if P2_18_C6=="vai ter um bom"
replace Q2_18_06= 1 if P2_18_C6=="VOTO DE CONFIAÇA"

replace Q2_19_01= 1 if P2_19_C5=="continuar"
replace Q2_19_01= 1 if P2_19_C5=="nada"
replace Q2_19_01= 1 if P2_19_C5=="nao ha progresso"
replace Q2_19_02= 1 if P2_19_C5=="MAS ESTA PROIBIDA E FAZER QUALQUER CREDITO COM BASE NO SEU DESEMPENHO."
replace Q2_19_02= 1 if P2_19_C5=="Não tem direito a tranferencia, e nem dieito a crédito"
replace Q2_19_02= 1 if P2_19_C5=="NAO TEM DIREITO A CREDITO BANCARIO"
replace Q2_19_02= 1 if P2_19_C5=="NAO TEM DIREITO O CREDITO"
replace Q2_19_02= 1 if P2_19_C5=="baixo rendimento"
replace Q2_19_04= 1 if P2_19_C5=="despedimento"
replace Q2_19_04= 1 if P2_19_C5=="DESPROMOSAO"
replace Q2_19_05= 1 if P2_19_C5=="É AVALIADO COM UMA NOTA SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="É AVALIADO NA FIXA COMO Mau professor"
replace Q2_19_05= 1 if P2_19_C5=="É LEVADO AO CONSELHO DISCIPLINAR"
replace Q2_19_05= 1 if P2_19_C5=="A AVALIAÇAO E NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="A AVALIAÇAO MAU OU SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="Aconselam o professor"
replace Q2_19_05= 1 if P2_19_C5=="ACONSELHADO"
replace Q2_19_05= 1 if P2_19_C5=="aconselhamento"
replace Q2_19_05= 1 if P2_19_C5=="aconselhao esta pessoa"
replace Q2_19_05= 1 if P2_19_C5=="aconselhdo"
replace Q2_19_05= 1 if P2_19_C5=="ALGUMAS ADIVERTENCIAS E AVALIAÇAO MAU"
replace Q2_19_05= 1 if P2_19_C5=="aminha avaliaçao sera negativa"
replace Q2_19_05= 1 if P2_19_C5=="AVALIAÇAI É REGULAR"
replace Q2_19_05= 1 if P2_19_C5=="AVALIAÇAO É NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="AVALIAÇAO É SUFICIENTE"
replace Q2_19_05= 1 if P2_19_C5=="AVALIAÇAO È NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="AVALIAÇAO è NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="Avaliação negativa"
replace Q2_19_05= 1 if P2_19_C5=="avaliaçao e negativa"
replace Q2_19_05= 1 if P2_19_C5=="avaliaçao negativa"
replace Q2_19_05= 1 if P2_19_C5=="AVALUAÇAO FINAL È NEGTIVA"
replace Q2_19_05= 1 if P2_19_C5=="AVLIAÇAO SERA MAU"
replace Q2_19_05= 1 if P2_19_C5=="BAIXA CLASSIFICAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="CHAMADA DE ATENÇÃO"
replace Q2_19_05= 1 if P2_19_C5=="CHAMADA DE ATENCAO"
replace Q2_19_05= 1 if P2_19_C5=="chamada de atenlao"
replace Q2_19_05= 1 if P2_19_C5=="chamada de atensao"
replace Q2_19_05= 1 if P2_19_C5=="chamada de atensao da diresao da escola"
replace Q2_19_05= 1 if P2_19_C5=="classificaçao negativa"
replace Q2_19_05= 1 if P2_19_C5=="CLASSIFICACAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="CONSELHOS"
replace Q2_19_05= 1 if P2_19_C5=="CONVERSAR COM O PROFESSOR PARA MELHORAR"
replace Q2_19_05= 1 if P2_19_C5=="correcao por parte do diretor"
replace Q2_19_05= 1 if P2_19_C5=="criticas"
replace Q2_19_05= 1 if P2_19_C5=="DA-SE UM SUFIX"
replace Q2_19_05= 1 if P2_19_C5=="DAO SUFICIENTE"
replace Q2_19_05= 1 if P2_19_C5=="DEDICAR MAIS PARA MELHORAR"
replace Q2_19_05= 1 if P2_19_C5=="è avaliado mau"
replace Q2_19_05= 1 if P2_19_C5=="é chamada atenção"
replace Q2_19_05= 1 if P2_19_C5=="E MAL AVALIADO"
replace Q2_19_05= 1 if P2_19_C5=="e negativo"
replace Q2_19_05= 1 if P2_19_C5=="è reprendido"
replace Q2_19_05= 1 if P2_19_C5=="FAZ SE REUNIAO"
replace Q2_19_05= 1 if P2_19_C5=="Fazer chamada de atençao para o seu melhoramentol"
replace Q2_19_05= 1 if P2_19_C5=="FICHA DE AVALIAÇAO  DESSE PROFESSOR TEM UMA NOTA NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="fixa negativa"
replace Q2_19_05= 1 if P2_19_C5=="GRADUADO COM UM SUF"
replace Q2_19_05= 1 if P2_19_C5=="IMPEDE A OUTRAS SITUAÇOES"
replace Q2_19_05= 1 if P2_19_C5=="impede uma boa avaliação no final do ano"
replace Q2_19_05= 1 if P2_19_C5=="LEVA MAU NA FICHA DE AVALIAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="leva um mau"
replace Q2_19_05= 1 if P2_19_C5=="levas uma mau"
replace Q2_19_05= 1 if P2_19_C5=="MÁ AVALIAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="MÁ CLASSIFICAÇÃO OU SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="MÁ CLASSIFICAÇAI"
replace Q2_19_05= 1 if P2_19_C5=="má avaliação"
replace Q2_19_05= 1 if P2_19_C5=="MAL"
replace Q2_19_05= 1 if P2_19_C5=="mal classificação"
replace Q2_19_05= 1 if P2_19_C5=="mal classificaçao"
replace Q2_19_05= 1 if P2_19_C5=="MAL CLASSIFICACAO"
replace Q2_19_05= 1 if P2_19_C5=="mal qualificaçao"
replace Q2_19_05= 1 if P2_19_C5=="MAL VALIA"
replace Q2_19_05= 1 if P2_19_C5=="mau"
replace Q2_19_05= 1 if P2_19_C5=="mau falado"
replace Q2_19_05= 1 if P2_19_C5=="mau resultado"
replace Q2_19_05= 1 if P2_19_C5=="NA FICHA DE AVALIA ÇAO LEVO MAU OU SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="na fixa tens um suficiente"
replace Q2_19_05= 1 if P2_19_C5=="NO FINAL DO LECTIVO UMA AVSLIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="NOTA MAU"
replace Q2_19_05= 1 if P2_19_C5=="nota negativa na avaliaçao"
replace Q2_19_05= 1 if P2_19_C5=="PROCESSO DISCIPLINAR"
replace Q2_19_05= 1 if P2_19_C5=="processo disciplinar, devolvem o professor ao secçao municipal"
replace Q2_19_05= 1 if P2_19_C5=="receba um mau ou sufixi"
replace Q2_19_05= 1 if P2_19_C5=="recebe um mau ou um sufixi"
replace Q2_19_05= 1 if P2_19_C5=="RECEBE UMA AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="REGISTA.SE O FRACASSO NO APROVEITAMENTO DOS ALUNOS"
replace Q2_19_05= 1 if P2_19_C5=="reonem com eli e chamao elhe atençao"
replace Q2_19_05= 1 if P2_19_C5=="REPREENSAO"
replace Q2_19_05= 1 if P2_19_C5=="resultado negativo"
replace Q2_19_05= 1 if P2_19_C5=="reunem"
replace Q2_19_05= 1 if P2_19_C5=="reunem com ele pelo conselho da escola"
replace Q2_19_05= 1 if P2_19_C5=="REUNIAO"
replace Q2_19_05= 1 if P2_19_C5=="sançao disciplinar"
replace Q2_19_05= 1 if P2_19_C5=="sançao moral"
replace Q2_19_05= 1 if P2_19_C5=="sancionado disciplinar"
replace Q2_19_05= 1 if P2_19_C5=="sao mau e sufixi"
replace Q2_19_05= 1 if P2_19_C5=="SER ACONSELHADAPARA MELHORAR"
replace Q2_19_05= 1 if P2_19_C5=="so aconselhada para arrajar novos metodo"
replace Q2_19_05= 1 if P2_19_C5=="SO AVALIADA NEGATIVAMENTE"
replace Q2_19_05= 1 if P2_19_C5=="SOU AVALIADA PISITIVAMENTE"
replace Q2_19_05= 1 if P2_19_C5=="SOU AVALIADO COM UMA NOTA BAIXA"
replace Q2_19_05= 1 if P2_19_C5=="SOU AVALIADO NEGATIVAMENTE"
replace Q2_19_05= 1 if P2_19_C5=="SOU ENCAMIINHADA PARA REPARTIÇAO DA EDUCAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="SOU MAL CLASSIFICAD0"
replace Q2_19_05= 1 if P2_19_C5=="SOU SANCIONADA"
replace Q2_19_05= 1 if P2_19_C5=="SOUA VALiada negativamente"
replace Q2_19_05= 1 if P2_19_C5=="SUFIX"
replace Q2_19_05= 1 if P2_19_C5=="sufixi ou mau"
replace Q2_19_05= 1 if P2_19_C5=="SUX"
replace Q2_19_05= 1 if P2_19_C5=="te um bom"
replace Q2_19_05= 1 if P2_19_C5=="TEM AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TEM CLASSIFICAÇAO MAU OU SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="tem como avaliaçao sufisi"
replace Q2_19_05= 1 if P2_19_C5=="TEM COMO NOTA AVALIATIVA MAU SUFIX"
replace Q2_19_05= 1 if P2_19_C5=="TEM MAU"
replace Q2_19_05= 1 if P2_19_C5=="tem na ficha de avaliçao sufici"
replace Q2_19_05= 1 if P2_19_C5=="TEM OMO NOTA NA FICHA DE AVALIAÇAO SUFICI"
replace Q2_19_05= 1 if P2_19_C5=="tem q ser suficiente ou mau"
replace Q2_19_05= 1 if P2_19_C5=="TEM UM MAU"
replace Q2_19_05= 1 if P2_19_C5=="TEM UMA AVALIA ÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TEM UMA AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="tem uma avaliaçao negativa"
replace Q2_19_05= 1 if P2_19_C5=="TEM UMA CLASSIFICAÇAO NEFATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TENHO ANALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TENHO MA CLASSIFICAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="tenho nota negativa ou sufissi na ficha de avaliaçao"
replace Q2_19_05= 1 if P2_19_C5=="TENHO UMA AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TENHO UMA AVALIAÇAO NEGATIVQA"
replace Q2_19_05= 1 if P2_19_C5=="TENHO UMA NOTA MA NA FICHA DE AVALIAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="TENHO UMA NOTA SUFICI NA AVALIAÇAO"
replace Q2_19_05= 1 if P2_19_C5=="TENHO UMA VALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="TENHONCOMOAVALIÇAAO SUFICI OU MAU"
replace Q2_19_05= 1 if P2_19_C5=="tens um mau"
replace Q2_19_05= 1 if P2_19_C5=="ter um mau"
replace Q2_19_05= 1 if P2_19_C5=="terei mau"
replace Q2_19_05= 1 if P2_19_C5=="TEREI NOTA REGULAR"
replace Q2_19_05= 1 if P2_19_C5=="TEREI UMA AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="um insuficiente"
replace Q2_19_05= 1 if P2_19_C5=="um mau"
replace Q2_19_05= 1 if P2_19_C5=="um sufixi"
replace Q2_19_05= 1 if P2_19_C5=="UMA AVALIAÇAO NEGATIVA"
replace Q2_19_05= 1 if P2_19_C5=="uma avaliaçao negativa"
replace Q2_19_05= 1 if P2_19_C5=="uma valiaçao negativa"
replace Q2_19_05= 1 if P2_19_C5=="ummau"
replace Q2_19_05= 1 if P2_19_C5=="XAMADA DE ATENÇAO"
replace Q2_19_05= 1 if P2_19_C5=="e submetido a um siminario"

forval n=2/6{
replace Q2_18_0`n' = . if Q2_18_01==1
}
forval n=2/5{
replace Q2_19_0`n' = . if Q2_19_01==1
}
foreach var in P2_186 P2_187 P2_18_C6 P2_195 P2_196 P2_19_C5{
lab var `var' "AUX"
}

gen Q2_21 = 1 if P2_215==0
order Q2_21, after(Q2_20)
replace Q2_21 = 0 if P2_215==1
replace Q2_21 = . if P2_216==1

replace Q2_21 = 0 if P2_21_C4=="APOIO MORAL"
replace Q2_21 = 0 if P2_21_C4=="apoi moral"
replace Q2_21 = 0 if P2_21_C4=="apoio moral"
replace Q2_21 = 1 if P2_21_C4=="dinheiro"
replace Q2_21 = 1 if P2_21_C4=="gratificaçoes, alimentos"
replace Q2_21 = 1 if P2_21_C4=="apoio financeiro"
replace Q2_21 = 1 if P2_21_C4=="algo alimentar"
lab val Q2_21 dummy
lab var Q2_21 "Teachers receive some kind of aditional (financial) support from community"

foreach var in P2_211 P2_212 P2_213 P2_214 P2_215 P2_216 P2_21_C4{
lab var `var' "AUX"
}

rename P2_22 Q2_22
recode Q2_22 (2=0)
lab val Q2_22 dummy
lab var Q2_22 "Teacher has other source of income"

rename P2_231 Q2_23_01
rename P2_232 Q2_23_02
rename P2_233 Q2_23_03
rename P2_234 Q2_23_04
rename P2_235 Q2_23_05
rename P2_236 Q2_23_06
rename P2_237 Q2_23_07
rename P2_238 Q2_23_08

lab var Q2_23_01 "Teaching in another public school."
lab var Q2_23_02 "Teaching in a private school."
lab var Q2_23_03 "Private paid lessons."
lab var Q2_23_04 "Trade business"
lab var Q2_23_05 "Agriculture"
lab var Q2_23_06 "Non-agricultural job"
lab var Q2_23_07 "Fishing"
lab var Q2_23_08 "Own business (informal)"

forval n=1/8{
replace Q2_23_0`n' = . if Q2_22==0
}
replace Q2_23_03 = 1 if P2_23_C9=="aulas privadas"
replace Q2_23_03 = 1 if P2_23_C9=="esplicaçao"
replace Q2_23_04 = 1 if P2_23_C9=="vendedora"
replace Q2_23_05 = 1 if P2_23_C9=="criador de gado"
replace Q2_23_06 = 1 if P2_23_C9=="tem uma pensão por ser ex militar"
replace Q2_23_06 = 1 if P2_23_C9=="empre dimento de hotelaria e turismo"
replace Q2_23_06 = 1 if P2_23_C9=="empresa privada"
replace Q2_23_06 = 1 if P2_23_C9=="cantina"
replace Q2_23_06 = 1 if P2_23_C9=="CAMBISTA"
replace Q2_23_08 = 1 if P2_23_C9=="pedreiro"
replace Q2_23_08 = 1 if P2_23_C9=="pintura"
replace Q2_23_08 = 1 if P2_23_C9=="serralheiro"
replace Q2_23_08 = 1 if P2_23_C9=="ELETRICISTA"

replace Q2_22 = 0 if P2_23_C9=="nao tem"

egen tot = rowtotal(Q2_23_01 Q2_23_02 Q2_23_03 Q2_23_04 Q2_23_05 Q2_23_06 Q2_23_07 Q2_23_08), missing
forval n=1/8{
replace Q2_23_0`n' = . if tot==0
}
drop tot

lab var P2_239 		"AUX"
lab var P2_23_C9	"AUX"

rename P2_24 Q2_24
replace Q2_24 = . if Q2_22==0
lab var Q2_24 "Other source of income value last month"
replace Q2_24 = Q2_24*1000 if Q2_24<300

order P2_1_C6 P2_38 P2_3_C8 P2_8_C8 P2_11_C7 P2_12_C6 P2_1610 P2_1611 P2_16_C10 P2_17_C7 P2_186 P2_187 P2_18_C6 P2_195 P2_196 P2_19_C5 P2_211 P2_212 P2_213 P2_214 P2_215 P2_216 P2_21_C4 P2_239 P2_23_C9, after(Q2_24)
}
********************************************************************************
********************************** SECTION 3 ***********************************
********************************************************************************
{
lab var P3_11 "Which grade do you currently teach?"
lab var P3_12 "Which other grade do you currently teach?"

drop P3_13

rename P3_11 Q3_01_01
rename P3_12 Q3_01_02

replace Q3_01_01 = Q3_01_01-1
replace Q3_01_02 = Q3_01_02-1

#delimit;
lab def Q3_01
0	"Pre-school"
1	"1st grade"
2	"2nd grade"
3	"3rd grade"
4	"4th grade"
5	"5th grade"
6	"6th grade"
7	"none (of these)"
;
#delimit cr
lab val Q3_01_01 Q3_01_02 Q3_01

lab var P3_201 "How many pre-school classes do you teach?"
lab var P3_202 "How many 1st grade classes do you teach?"
lab var P3_203 "How many 2nd grade classes do you teach?"
lab var P3_204 "How many 3rd grade classes do you teach?"
lab var P3_205 "How many 4th grade classes do you teach?"
lab var P3_206 "How many 5th grade classes do you teach?"
lab var P3_207 "How many 6th grade classes do you teach?"

rename P3_201 	Q3_02_00
rename P3_202 	Q3_02_01
rename P3_203 	Q3_02_02
rename P3_204 	Q3_02_03
rename P3_205 	Q3_02_04
rename P3_206 	Q3_02_05
rename P3_207	Q3_02_06

forval n=0/6{
replace Q3_02_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
}

lab var P3_301 "How many students are in the pre-school classes that you teach?"
lab var P3_302 "How many students are in the 1st grade classes that you teach?"
lab var P3_303 "How many students are in the 2nd grade classes that you teach?"
lab var P3_304 "How many students are in the 3rd grade classes that you teach?"
lab var P3_305 "How many students are in the 4th grade classes that you teach?"
lab var P3_306 "How many students are in the 5th grade classes that you teach?"
lab var P3_307 "How many students are in the 6th grade classes that you teach?"

rename P3_301 	Q3_03_00
rename P3_302 	Q3_03_01
rename P3_303 	Q3_03_02
rename P3_304 	Q3_03_03
rename P3_305 	Q3_03_04
rename P3_306 	Q3_03_05
rename P3_307	Q3_03_06

forval n=0/6{
replace Q3_03_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
}

lab var P3_401 "How many students missed just one day last week in the pre-school classes that you teach?"
lab var P3_402 "How many students missed just one day last week in the 1st grade classes that you teach?"
lab var P3_403 "How many students missed just one day last week in the 2nd grade classes that you teach?"
lab var P3_404 "How many students missed just one day last week in the 3rd grade classes that you teach?"
lab var P3_405 "How many students missed just one day last week in the 4th grade classes that you teach?"
lab var P3_406 "How many students missed just one day last week in the 5th grade classes that you teach?"
lab var P3_407 "How many students missed just one day last week in the 6th grade classes that you teach?"

rename P3_401 	Q3_04_00
rename P3_402 	Q3_04_01
rename P3_403 	Q3_04_02
rename P3_404 	Q3_04_03
rename P3_405 	Q3_04_04
rename P3_406 	Q3_04_05
rename P3_407	Q3_04_06

forval n=0/6{
replace Q3_04_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
}

lab var P3_501 "How many students missed more than one day last week in the pre-school classes that you teach?"
lab var P3_502 "How many students missed more than one day last week in the 1st grade classes that you teach?"
lab var P3_503 "How many students missed more than one day last week in the 2nd grade classes that you teach?"
lab var P3_504 "How many students missed more than one day last week in the 3rd grade classes that you teach?"
lab var P3_505 "How many students missed more than one day last week in the 4th grade classes that you teach?"
lab var P3_506 "How many students missed more than one day last week in the 5th grade classes that you teach?"
lab var P3_507 "How many students missed more than one day last week in the 6th grade classes that you teach?"

rename P3_501 	Q3_05_00
rename P3_502 	Q3_05_01
rename P3_503 	Q3_05_02
rename P3_504 	Q3_05_03
rename P3_505 	Q3_05_04
rename P3_506 	Q3_05_05
rename P3_507	Q3_05_06

forval n=0/6{
replace Q3_05_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
}

***
***
***
***
***
***
*** get some help with this >>>

lab var P3_61 "All subjects are teached in these classes"
lab var P3_62 "Portuguese is teached in these classes"
lab var P3_63 "Mathematics is teached in these classes"
lab var P3_64 "Geography is teached in these classes"
lab var P3_65 "History is teached in these classes"
lab var P3_66 "Natural science is teached in these classes"
lab var P3_67 "Manual work is teached in these classes"
lab var P3_68 "Other topics are teached in these classes (specify)"

rename P3_61 	Q3_06_01
rename P3_62 	Q3_06_02
rename P3_63 	Q3_06_03
rename P3_64 	Q3_06_04
rename P3_65 	Q3_06_05
rename P3_66 	Q3_06_06
rename P3_67	Q3_06_07
rename P3_68	Q3_06_08

forval n=1/8{
lab val Q3_06_0`n' dummy
}
rename P3_6_C8 Q3_06_08_other
lab var Q3_06_08_other "(Other specified) Other topics are teached in these classes"

/*
gen Q3_06_08 = .
gen Q3_06_09 = .
gen Q3_06_10 = .

lab var Q3_06_08 "Music is teached in these classes"
lab var Q3_06_09 "Physical education is teached in these classes"
lab var Q3_06_10 "XX is teached in these classes"

lab var P3_68 "Other: (specify)."
*/

*** get some help with this ^^^
***
***
***
***

lab var P3_7 "How often are meetings between the teacher and the parent/guardian in this school?"
rename P3_7 Q3_07

replace Q3_07 = . if inlist(Q3_07,6,7)
recode Q3_07 (8=0)

replace Q3_07 =0 if P3_7_C6=="nao"
replace Q3_07 =0 if P3_7_C6=="nao aparecem"
replace Q3_07 =0 if P3_7_C6=="nao por fala de comparencia dos pais"
replace Q3_07 =. if P3_7_C6=="ainda"
replace Q3_07 =. if P3_7_C6=="ainda nao"
replace Q3_07 =. if P3_7_C6=="anda nao"
replace Q3_07 =. if P3_7_C6=="este ano ainda nao"
replace Q3_07 =. if P3_7_C6=="SEMPRE QUE OUVER NECESSIDADE"
replace Q3_07 =. if P3_7_C6=="VARIA"
replace Q3_07 =. if P3_7_C6=="dependente do comportamento do aluno"
replace Q3_07 =. if P3_7_C6=="dependentemente do comportamento do aluno"
replace Q3_07 =. if P3_7_C6=="nao houve nenhuma reuniao so nvo nesta escola"
replace Q3_07 =. if P3_7_C6=="quando contactados"
replace Q3_07 =2 if P3_7_C6=="duas vezes por mes"
replace Q3_07 =2 if P3_7_C6=="quinzinal mente"
replace Q3_07 =3 if P3_7_C6=="2 vez por trimestre"
replace Q3_07 =3 if P3_7_C6=="2 vezes por trimestre"
replace Q3_07 =3 if P3_7_C6=="DUAS VEZES POR TRMESTRE"
replace Q3_07 =3 if P3_7_C6=="2 POR TRIMESTRE"
replace Q3_07 =4 if P3_7_C6=="2 vez por ano"
replace Q3_07 =4 if P3_7_C6=="no final de cada trimestre"
replace Q3_07 =4 if P3_7_C6=="no pr7ncipio de cada trimestre"
replace Q3_07 =5 if P3_7_C6=="NO PRINCIPIO E NO ULTIMO TRIMESTRE"

#delimit;
lab def Q3_07
0 "Never"
1 "Once a week"
2 "Once every two weeks"
3 "Once a month"
4 "Once a trimester"
5 "Once a year"
;
#delimit cr
lab val Q3_07 Q3_07

lab var P3_7_C6 "AUX"

lab var P3_8 "How satisfied are you with these meetings?"
rename P3_8 Q3_08
replace Q3_08 = . if Q3_08==5

#delimit;
lab def satisfied
1	"Very satisfied"
2	"Satisfied"
3	"Unsatisfied"
4	"Very Unsatisfied"
;
#delimit cr
lab val Q3_08 satisfied

lab var P3_91 "(1) Why are you not satisfied with these meetings?"
lab var P3_92 "(2) Why are you not satisfied with these meetings?"

rename P3_91 Q3_09_01
rename P3_92 Q3_09_02

#delimit;
lab def Q3_09
1 "No room for these meetings"
2 "Poor parental involvement"
3 "Little time available to speak to parents/guardians individually"
4 "Bad will of parents/guardians"
5 "Lack of respect of parents/guardians towards teachers"
;
#delimit cr
lab val Q3_09_01 Q3_09_02 Q3_09

replace Q3_09_01 = . if Q3_09_01==6
replace Q3_09_01 = 2 if P3_9_C6=="PORQUE POUCOS ENCARREGADOS APARECEM NESSES 2ENCONTROS"
replace Q3_09_01 = 2 if P3_9_C6=="nao aparesse encarregado nas reunioa"
replace Q3_09_01 = . if P3_9_C6=="porque quis falr com eles em relaçao os alunos"
replace Q3_09_01 = . if P3_9_C6=="ainda nao teve uma reuniao com eles"

lab var P3_9_C6 "AUX"

lab var P3_100 "How many parents/guardians of students in the pre-school classes that you teach participate in these meetings?"
lab var P3_101 "How many parents/guardians of students in the 1st grade classes that you teach participate in these meetings?"
lab var P3_102 "How many parents/guardians of students in the 2nd grade classes that you teach participate in these meetings?"
lab var P3_103 "How many parents/guardians of students in the 3rd grade classes that you teach participate in these meetings?"
lab var P3_104 "How many parents/guardians of students in the 4th grade classes that you teach participate in these meetings?"
lab var P3_105 "How many parents/guardians of students in the 5th grade classes that you teach participate in these meetings?"
lab var P3_106 "How many parents/guardians of students in the 6th grade classes that you teach participate in these meetings?"

rename P3_100 	Q3_10_00
rename P3_101 	Q3_10_01
rename P3_102 	Q3_10_02
rename P3_103 	Q3_10_03
rename P3_104 	Q3_10_04
rename P3_105 	Q3_10_05
rename P3_106	Q3_10_06

forval n=0/6{
replace Q3_10_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
}

recode P3_111 (2=0)
rename P3_111 Q3_11
lab var Q3_11 "Would you be available to meet with a parent/guardian outside of the scheduled meeting times with parents if necessary?"
lab val Q3_11 dummy

lab var P3_120 "The pre-school classes that you teach have a parents/guardians group?"
lab var P3_121 "The 1st grade classes that you teach have a parents/guardians group?"
lab var P3_122 "The 2nd grade classes that you teach have a parents/guardians group?"
lab var P3_123 "The 3rd grade classes that you teach have a parents/guardians group?"
lab var P3_124 "The 4th grade classes that you teach have a parents/guardians group?"
lab var P3_125 "The 5th grade classes that you teach have a parents/guardians group?"
lab var P3_126 "The 6th grade classes that you teach have a parents/guardians group?"

rename P3_120 	Q3_12_00
rename P3_121 	Q3_12_01
rename P3_122 	Q3_12_02
rename P3_123 	Q3_12_03
rename P3_124 	Q3_12_04
rename P3_125 	Q3_12_05
rename P3_126	Q3_12_06

forval n=0/6{
replace Q3_12_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
replace Q3_12_0`n' = . if Q3_12_0`n'==3
recode Q3_12_0`n' (2=0)
lab val Q3_12_0`n' dummy
}

drop P3_1302 P3_1303 P3_130_C5 P3_1313 P3_1323 P3_132_C5 P3_1333 P3_133_C5 P3_1343 P3_1352 P3_1353 P3_135_C5 P3_1362 P3_1363 P3_136_C5

rename P3_1301 Q3_13_00_01
lab var Q3_13_00_01 "(1) How are representatives of the parents/guardians group assigned in the pre-school classes that you teach?"

rename P3_1311 Q3_13_01_01
rename P3_1312 Q3_13_01_02
lab var Q3_13_01_01 "(1) How are representatives of the parents/guardians group assigned in the 1st grade classes that you teach?"
lab var Q3_13_01_02 "(2) How are representatives of the parents/guardians group assigned in the 1st grade classes that you teach?"

rename P3_1321 Q3_13_02_01
rename P3_1322 Q3_13_02_02
lab var Q3_13_02_01 "(1) How are representatives of the parents/guardians group assigned in the 2nd grade classes that you teach?"
lab var Q3_13_02_02 "(2) How are representatives of the parents/guardians group assigned in the 2nd grade classes that you teach?"

rename P3_1331 Q3_13_03_01
rename P3_1332 Q3_13_03_02
lab var Q3_13_03_01 "(1) How are representatives of the parents/guardians group assigned in the 3rd grade classes that you teach?"
lab var Q3_13_03_02 "(2) How are representatives of the parents/guardians group assigned in the 3rd grade classes that you teach?"


rename P3_1341 Q3_13_04_01
rename P3_1342 Q3_13_04_02
lab var Q3_13_04_01 "(1) How are representatives of the parents/guardians group assigned in the 4th grade classes that you teach?"
lab var Q3_13_04_02 "(2) How are representatives of the parents/guardians group assigned in the 4th grade classes that you teach?"

rename P3_1351 Q3_13_05_01
lab var Q3_13_05_01 "(1) How are representatives of the parents/guardians group assigned in the 5th grade classes that you teach?"

rename P3_1361 Q3_13_06_01
lab var Q3_13_06_01 "(1) How are representatives of the parents/guardians group assigned in the 6th grade classes that you teach?"

#delimit;
lab def assign
1 "Elected by all parents present at the first parent meeting"
2 "The direction of the school chooses the representatives"
3 "Teachers choose the representatives"
4 "They are the same representatives from last year"
5 "Other"
;
#delimit cr

foreach var in Q3_13_00_01 Q3_13_01_01 Q3_13_01_02 Q3_13_02_01 Q3_13_02_02 Q3_13_03_01 Q3_13_03_02 Q3_13_04_01 Q3_13_04_02 Q3_13_05_01 Q3_13_06_01{
replace `var' = . if inlist(`var',5,6)
lab val `var' assign
}

replace Q3_13_01_01 = 1 if P3_131_C5=="Votação"
replace Q3_13_04_01 = 1 if P3_134_C5=="os representante dos pais ¥¥e   eleito pelo conjunto de pais"

lab var P3_131_C5 "AUX"
lab var P3_134_C5 "AUX"

lab var P3_141 "What is the name of the representatives of the parents/guardians group of the pre-school classes that you teach?"
lab var P3_142 "What is the name of the representatives of the parents/guardians group of the 1st grade classes that you teach?"
lab var P3_143 "What is the name of the representatives of the parents/guardians group of the 2nd grade classes that you teach?"
lab var P3_144 "What is the name of the representatives of the parents/guardians group of the 3rd grade classes that you teach?"
lab var P3_145 "What is the name of the representatives of the parents/guardians group of the 4th grade classes that you teach?"
lab var P3_146 "What is the name of the representatives of the parents/guardians group of the 5th grade classes that you teach?"
lab var P3_147 "What is the name of the representatives of the parents/guardians group of the 6th grade classes that you teach?"

rename P3_141 	Q3_14_00
rename P3_142 	Q3_14_01
rename P3_143 	Q3_14_02
rename P3_144 	Q3_14_03
rename P3_145 	Q3_14_04
rename P3_146 	Q3_14_05
rename P3_147	Q3_14_06

lab var P3_15_R "Are there parents/guardians groups in any of the other classes in this school?"
lab var P3_150 "Is there a representative of the parents/guardians group of the pre-school classes that you do not teach?"
lab var P3_151 "Is there a representative of the parents/guardians group of the 1st grade classes that you do not teach?"
lab var P3_152 "Is there a representative of the parents/guardians group of the 2nd grade classes that you do not teach?"
lab var P3_153 "Is there a representative of the parents/guardians group of the 3rd grade classes that you do not teach?"
lab var P3_154 "Is there a representative of the parents/guardians group of the 4th grade classes that you do not teach?"
lab var P3_155 "Is there a representative of the parents/guardians group of the 5th grade classes that you do not teach?"
lab var P3_156 "Is there a representative of the parents/guardians group of the 6th grade classes that you do not teach?"

rename P3_15_R 	Q3_15
rename P3_150 	Q3_15_00
rename P3_151 	Q3_15_01
rename P3_152 	Q3_15_02
rename P3_153 	Q3_15_03
rename P3_154 	Q3_15_04
rename P3_155 	Q3_15_05
rename P3_156	Q3_15_06


foreach var in Q3_15 Q3_15_00 Q3_15_01 Q3_15_02 Q3_15_03 Q3_15_04 Q3_15_05 Q3_15_06{
recode `var' (3=.) (2=0)
lab val `var' dummy
}

lab var P3_160 "What is the name of the representatives of the parents/guardians group of the pre-school classes that you do not teach?"
lab var P3_161 "What is the name of the representatives of the parents/guardians group of the 1st grade classes that you do not teach?"
lab var P3_162 "What is the name of the representatives of the parents/guardians group of the 2nd grade classes that you do not teach?"
lab var P3_163 "What is the name of the representatives of the parents/guardians group of the 3rd grade classes that you do not teach?"
lab var P3_164 "What is the name of the representatives of the parents/guardians group of the 4th grade classes that you do not teach?"
lab var P3_165 "What is the name of the representatives of the parents/guardians group of the 5th grade classes that you do not teach?"
lab var P3_166 "What is the name of the representatives of the parents/guardians group of the 6th grade classes that you do not teach?"

rename P3_160 	Q3_16_00
rename P3_161 	Q3_16_01
rename P3_162 	Q3_16_02
rename P3_163 	Q3_16_03
rename P3_164 	Q3_16_04
rename P3_165 	Q3_16_05
rename P3_166	Q3_16_06

lab var P3_17 "Is there a commission of parents and guardians at the school?"
rename P3_17 Q3_17
recode Q3_17 (3=.) (2=0)
lab val Q3_17 dummy

rename P3_181 Q3_18_01
rename P3_182 Q3_18_02
rename P3_183 Q3_18_03
lab var Q3_18_01 "(1) How are representatives of the commission of parents and guardians assigned?"
lab var Q3_18_02 "(2) How are representatives of the commission of parents and guardians assigned?"
lab var Q3_18_03 "(3) How are representatives of the commission of parents and guardians assigned?"
replace Q3_18_01 = . if inlist(Q3_18_01,6)
replace Q3_18_01 = 1 if P3_18_C5=="votação"
lab val Q3_18_01 Q3_18_02 Q3_18_03 assign
lab var P3_18_C5 "AUX"

lab var P3_190 "Do you regularly see any of the parents/guardians of the pre-school classes that you teach outside the school?"
lab var P3_191 "Do you regularly see any of the parents/guardians of the 1st grade classes that you teach outside the school?"
lab var P3_192 "Do you regularly see any of the parents/guardians of the 2nd grade classes that you teach outside the school?"
lab var P3_193 "Do you regularly see any of the parents/guardians of the 3rd grade classes that you teach outside the school?"
lab var P3_194 "Do you regularly see any of the parents/guardians of the 4th grade classes that you teach outside the school?"
lab var P3_195 "Do you regularly see any of the parents/guardians of the 5th grade classes that you teach outside the school?"
lab var P3_196 "Do you regularly see any of the parents/guardians of the 6th grade classes that you teach outside the school?"

rename P3_190 	Q3_19_00
rename P3_191 	Q3_19_01
rename P3_192 	Q3_19_02
rename P3_193 	Q3_19_03
rename P3_194 	Q3_19_04
rename P3_195 	Q3_19_05
rename P3_196	Q3_19_06

forval n=0/6{
recode Q3_19_0`n' (2=0)
lab val Q3_19_0`n' dummy
}

lab var P3_20 "Do you discuss with them (see Q3_19) school-related issues outside the school?"
rename P3_20 Q3_20
recode Q3_20 (2=0)
lab val Q3_20 dummy

lab var P3_210 "Do any of the parents/guardians of the pre-school classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_211 "Do any of the parents/guardians of the 1st grade classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_212 "Do any of the parents/guardians of the 2nd grade classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_213 "Do any of the parents/guardians of the 3rd grade classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_214 "Do any of the parents/guardians of the 4th grade classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_215 "Do any of the parents/guardians of the 5th grade classes that you teach come from your family or fiends and do you usually meet them out of school?"
lab var P3_216 "Do any of the parents/guardians of the 6th grade classes that you teach come from your family or fiends and do you usually meet them out of school?"

rename P3_210 	Q3_21_00
rename P3_211 	Q3_21_01
rename P3_212 	Q3_21_02
rename P3_213 	Q3_21_03
rename P3_214 	Q3_21_04
rename P3_215 	Q3_21_05
rename P3_216	Q3_21_06

forval n=0/6{
replace Q3_21_0`n' = . if Q3_01_01!=`n' & Q3_01_02!=`n'
recode Q3_21_0`n' (2=0)
lab val Q3_21_0`n' dummy
}

lab var P3_22 "Do you discuss with them (see Q3_21) school-related issues outside the school?"
rename P3_22 Q3_22
recode Q3_22 (2=0)
lab val Q3_22 dummy

lab var P3_23 "How many desks are available today in the selected classroom?"
lab var P3_24 "How many desks are in poor condition?"
lab var P3_25 "How many of these desks were received new this year?"
lab var P3_26 "How many chairs are available today in the selected classroom?"
lab var P3_27 "How many chairs are in bad condition?"
lab var P3_28 "How many of these new chairs were received this year?"
lab var P3_29 "How many chalkboards are available today in the selected classroom?"
lab var P3_30 "How many tests did you give to students in the selected class in the second quarter of the previous school year (2013)?"

rename P3_23 Q3_23
rename P3_24 Q3_24
rename P3_25 Q3_25
rename P3_26 Q3_26
rename P3_27 Q3_27
rename P3_28 Q3_28
rename P3_29 Q3_29
rename P3_30 Q3_30

lab var P3_3001 "First most used teaching method"
lab var P3_3002 "Second most used teaching method"
lab var P3_3003 "Third most used teaching method"

rename P3_3001 Q3_31_01
rename P3_3002 Q3_31_02
rename P3_3003 Q3_31_03
rename P3_3001_C8 	Q3_31_01_other
rename P3_3002_C9 	Q3_31_02_other
rename P3_3003_C10	Q3_31_03_other

lab var Q3_31_01_other "(Other) First most used teaching method"
lab var Q3_31_02_other "(Other) Second most used teaching method"
lab var Q3_31_03_other "(Other) Third most used teaching method"

#delimit;
lab def Q3_31
1	"Explain and read to students without expecting them to repeat"
2	"Write on the chalkboard as they copy to the notebooks"
3	"Mechanical learning, having students repeat several times"
4	"Have students read aloud one by one"
5	"Individual study, allowing students to read in silence"
6	"Discuss and address the topics interactively with students"
7	"Divide the class into small groups and allow discussion between them"
8	"Other: (specify)"
;
#delimit cr
lab val Q3_31_01 Q3_31_02 Q3_31_03 Q3_31

lab var P3_32 "Do you have a 'lesson plan' for this school year (2014)?"
rename P3_32 Q3_32
recode Q3_32 (3=0)
lab def Q3_32 1 "Yes, prepared by teacher" 2 "Yes, prepared by ministry" 0 "No"
lab val Q3_32 Q3_32

lab var P3_33 				"Do you have a 'point journal' or summary book?"
lab var P3_34 				"Do you have a plan for today's lesson or for the next lesson?"
lab var P35_43_Q1_Cod_Inst 	"Suspend and/or kick out: used as disciplinary method?"
lab var P35_43_Q2_Cod_Inst 	"Punish physically: used as disciplinary method?"
lab var P35_43_Q3_Cod_Inst 	"Give extra classes and/or homework to students: used as disciplinary method?"
lab var P35_43_Q4_Cod_Inst 	"Keep students in the classroom/school outside the normal class period: used as disciplinary method?"
lab var P35_43_Q5_Cod_Inst 	"Prohibit some sport or other recreational activity: used as disciplinary method?"
lab var P35_43_Q6_Cod_Inst 	"Send communication or talk to parents / guardians: used as disciplinary method?"
lab var P35_43_Q7_Cod_Inst 	"Obligate to do physical work / manual labor: used as disciplinary method?"
lab var P35_43_Q8_Cod_Inst 	"Forcing to pass the interval within the room: used as disciplinary method?"
lab var P3_43Q 				"Other disciplinary methods used in schools nowadays: used as disciplinary method?"

rename P3_33				Q3_33
rename P3_34				Q3_34
rename P35_43_Q1_Cod_Inst 	Q3_35
rename P35_43_Q2_Cod_Inst 	Q3_36
rename P35_43_Q3_Cod_Inst 	Q3_37
rename P35_43_Q4_Cod_Inst 	Q3_38
rename P35_43_Q5_Cod_Inst 	Q3_39
rename P35_43_Q6_Cod_Inst 	Q3_40
rename P35_43_Q7_Cod_Inst 	Q3_41
rename P35_43_Q8_Cod_Inst 	Q3_42
rename P3_43Q				Q3_43

forval n=33/42{
recode Q3_`n' (2=0)
lab val Q3_`n' dummy
}
order P3_7_C6 P3_9_C6 P3_131_C5 P3_134_C5 P3_18_C5, after(Q3_43)
}
********************************************************************************
********************************** SECTION 4 ***********************************
********************************************************************************
{
#delimit ;
;
lab def freq
1	"Very often"
2	"Often"
3	"Sometimes"
4	"Rarely"
5	"Never"
;
#delimit cr

rename P4_(#) Q4_0(#)

forval n=1/6{
replace Q4_0`n' = . if Q4_0`n'==6
lab val Q4_0`n' freq
}

lab var Q4_01 "How often do teachers give private classes to their own students?"
lab var Q4_02 "How often do teachers give private classes to other students?"
lab var Q4_03 "How often do parents ask the teacher of their child to give private classes?"
lab var Q4_04 "How often do parents ask another teacher to give private classes?"
lab var Q4_05 "How often do you give private classes to your own students"
lab var Q4_06 "How often do you give private classes to other students"

replace Q4_07 = . if inlist(Q4_06,5,.)
lab var Q4_07 "Number of hours per week giving private classes"

drop P4_83
rename P4_81 Q4_08_01
rename P4_82 Q4_08_02

#delimit ;
;
lab def Q4_08
1	"School"
2	"Home teacher"
3	"Home student"
4	"Church"
5	"Community building"
6	"House family or friend"
7	"Rented space"
;
lab val Q4_08_01 Q4_08_02 Q4_08;
#delimit cr

lab var Q4_08_01 "(1) Location of private classes"
lab var Q4_08_02 "(2) Location of private classes"

replace Q4_08_01 = . if Q4_08_01==6
replace Q4_08_02 = . if Q4_08_02==6
replace Q4_08_01 = 2 if P4_8_C6=="em casa"
replace Q4_08_01 = 6 if P4_8_C6=="Amigo"

lab var P4_8_C6 "AUX"

replace Q4_09 = . if inlist(Q4_06,5,.)
lab var Q4_09 "Hour tarif private classes"

replace Q4_09 = Q4_09*1000 if Q4_09<10
replace Q4_09 = . if Q4_09==29

rename P4_10 Q4_10
replace Q4_10 = . if Q4_10==5

#delimit ;
;
lab def Q4_10
1 "Parents / guardians request private lessons for their children"
2 "Some students need extra help and support"
3 "More support is needed to cover all of the planned matter"
4 "You need more money to support your family"
;
lab val Q4_10 Q4_10;
#delimit cr
lab var Q4_10 "Main reason to give private classes (paid)"

lab var P4_10_C5 "AUX"

rename P4_11 Q4_11
replace Q4_11 = . if Q4_11==5
lab var Q4_11 "Do you think private classes help students to perform better?"
#delimit ;
;
lab def Q4_11
1	"Usually helpful"
2	"Sometimes helpful"
3	"Rarely helpful"
4	"Not helpful"
;
lab val Q4_11 Q4_11;
#delimit cr

rename P4_12_Dinheiro_Q1	Q4_12_01_money
rename P4_12_Presente_Q1	Q4_12_01_gift
rename P4_12_Servico_Q1		Q4_12_01_service

recode Q4_12_01_money (2=0)
recode Q4_12_01_gift (2=0)
recode Q4_12_01_service (2=0)

lab val Q4_12_01_money Q4_12_01_gift Q4_12_01_service dummy

destring P4_12_Presente_Q1_C1, replace
destring P4_12_Servico_Q1_C1, replace

rename P4_12_Dinheiro_Q1_C1 Q4_12_02_money
rename P4_12_Presente_Q1_C1 Q4_12_02_gift
rename P4_12_Servico_Q1_C1 Q4_12_02_service

lab var Q4_12_01_money 			"Received a present from parents in the form of money during the last year"
lab var Q4_12_01_gift 			"Received a present from parents in the form of an object during the last year"
lab var Q4_12_01_service 		"Received a present from parents in the form of a service during the last year"
lab var Q4_12_02_money 			"Value of monitary present"
lab var Q4_12_02_gift 			"Number of objects received as present"
lab var Q4_12_02_service 		"Hours of service received as present"

order P4_8_C6 P4_10_C5, after(Q4_12_02_service)

** Q4_12_02_gift : not cleaned.. unclear questioning.. what do we want from this question?

}
********************************************************************************
********************************** SECTION 5 ***********************************
********************************************************************************
{
lab var P5_1 "Someone of the school or ministry formally evaluates your performance"
rename P5_1 Q5_01
recode Q5_01 (2=0)
lab val Q5_01 dummy

lab var P5_2_301 "Method to evaluate performance: Observation in the classroom"
lab var P5_2_302 "Method to evaluate performance: Follow-up of the classifications in the exams of the students"
lab var P5_2_303 "Method to evaluate performance: Follow-up of the work developed by the students"
lab var P5_2_304 "Method to evaluate performance: Follow-up of student attendance"
lab var P5_2_305 "Method to evaluate performance: Interviews with school officials"
lab var P5_2_306 "Method to evaluate performance: Approval of the plans of the subject to be taught"
lab var P5_2_307 "Method to evaluate performance: Monitoring of daily teaching tasks"
lab var P5_2_308 "Method to evaluate performance: Follow-up of teachers' attendance"
lab var P5_2_309 "Method to evaluate performance: Follow-up of other staff records"
lab var P5_2_310 "Method to evaluate performance: Observation of parents' satisfaction with the performance of their children"
lab var P5_2_311 "Method to evaluate performance: Follow-up of the reports submitted"

foreach var in P5_2_301 P5_2_302 P5_2_303 P5_2_304 P5_2_305 P5_2_306 P5_2_307 P5_2_308 P5_2_309 P5_2_310 P5_2_311{
replace `var' = . if Q5_01==0
lab val `var' dummy
}
replace P5_2_311 = 0 if P5_2_311==1
replace P5_2_311 = 1 if P5_2_3_C11=="tem uma ficha de avaliação"

lab var P5_2_3_C11 "AUX"

egen tot = rowtotal(P5_2_301 P5_2_302 P5_2_303 P5_2_304 P5_2_305 P5_2_306 P5_2_307 P5_2_308 P5_2_309 P5_2_310 P5_2_311), missing
foreach var in P5_2_301 P5_2_302 P5_2_303 P5_2_304 P5_2_305 P5_2_306 P5_2_307 P5_2_308 P5_2_309 P5_2_310 P5_2_311{
replace `var' = . if tot==0
}
drop tot

rename P5_2_3(##) Q5_02_(##)

drop P5_2_30_C11

lab var P5_2_30_C1_Q1 "Evaluater performance: Observation in the classroom"
lab var P5_2_30_C2_Q1 "Evaluater performance: Follow-up of the classifications in the exams of the students"
lab var P5_2_30_C3_Q1 "Evaluater performance: Follow-up of the work developed by the students"
lab var P5_2_30_C4_Q1 "Evaluater performance: Follow-up of student attendance"
lab var P5_2_30_C5_Q1 "Evaluater performance: Interviews with school officials"
lab var P5_2_30_C6_Q1 "Evaluater performance: Approval of the plans of the subject to be taught"
lab var P5_2_30_C7_Q1 "Evaluater performance: Monitoring of daily teaching tasks"
lab var P5_2_30_C8_Q1 "Evaluater performance: Follow-up of teachers' attendance"
lab var P5_2_30_C9_Q1 "Evaluater performance: Follow-up of other staff records"
lab var P5_2_30_C10_Q1 "Evaluater performance: Observation of parents' satisfaction with the performance of their children"
lab var P5_2_30_C11_Q1 "Evaluater performance: Follow-up of the reports submitted"

# delimit;
lab def Q5_03
1	"School director"
2	"School subdirector"
3	"Senior teacher"
4	"Other teacher"
5	"Representative of provincial education board"
6	"Representative of municipal education board"
7	"Representative of the ministry of education"
8	"School board"
9	"Other"
;
# delimit cr

** no specification for other **

foreach var in P5_2_30_C1_Q1 P5_2_30_C2_Q1 P5_2_30_C3_Q1 P5_2_30_C4_Q1 P5_2_30_C5_Q1 P5_2_30_C6_Q1 P5_2_30_C7_Q1 P5_2_30_C8_Q1 P5_2_30_C9_Q1 P5_2_30_C10_Q1 P5_2_30_C11_Q1{
replace `var' = . if Q5_01==0
lab val `var' Q5_03
recode `var' (6=7) (7=8) (8=6)
}

replace P5_2_30_C11_Q1 = . if P5_2_3_C11!="tem uma ficha de avaliação"

rename P5_2_30_C(#)_Q1 Q5_03_0(#)
rename P5_2_30_C(##)_Q1 Q5_03_(##)

rename P5_4 Q5_04
recode Q5_04 (2=0)
lab val Q5_04 dummy
lab var Q5_04 "The existing evaluation improves performance"

lab var P5_51 "The evaluation provides feedback on teaching methods"
lab var P5_52 "The evaluation improves incentives for teachers"
lab var P5_53 "The evaluation improves students' academic incentives"
lab var P5_54 "The evaluation improves in a different way performance"
lab var P5_5_C4 "(Other) The evaluation improves in a different way performance"

rename P5_5(#) Q5_05_0(#)
rename P5_5_C4 Q5_05_04_other

lab val Q5_05_01 Q5_05_02 Q5_05_03 Q5_05_04 dummy

lab var P5_6 "Number of days arrived late during the last two weeks"
lab var P5_7 "Number of days missed during the last two weeks"
rename P5_6 Q5_06
rename P5_7 Q5_07

lab var P5_8_901 "Missed days because of own sickness"
lab var P5_8_902 "Missed days because of sickness family member"
lab var P5_8_903 "Missed days because of death family member"
lab var P5_8_904 "Missed days because of other family emergency"
lab var P5_8_905 "Missed days because of picking up salary in the village center"
lab var P5_8_906 "Missed days to buy school supplies"
lab var P5_8_907 "Missed days because of a workshop/training"
lab var P5_8_908 "Missed days because of another reason related with the function"
lab var P5_8_909 "Missed days because of second job"
lab var P5_8_910 "Missed days because of unforseen circumstances such as rain or transport"

rename P5_8_9(##) Q5_07_(##)

replace Q5_07 = 0 if P5_8_9_C10=="nao faltou"
foreach var in Q5_07_01 Q5_07_02 Q5_07_03 Q5_07_04 Q5_07_05 Q5_07_06 Q5_07_07 Q5_07_08 Q5_07_09 Q5_07_10{
replace `var' = . if Q5_07==0
lab val `var' dummy
}

replace Q5_07_01= 1 if P5_8_9_C10=="indisosta"
replace Q5_07_03= 1 if P5_8_9_C10=="MORTE DE FAMILIAR"
replace Q5_07_03= 1 if P5_8_9_C10=="esteve no obito"
replace Q5_07_03= 1 if P5_8_9_C10=="obito"
replace Q5_07_04= 1 if P5_8_9_C10=="problemas familias"
replace Q5_07_04= 1 if P5_8_9_C10=="PREOCUPAÇAO FAMILIAR"
replace Q5_07_07= 1 if P5_8_9_C10=="fez inscriçao na faculdade"
replace Q5_07_07= 1 if P5_8_9_C10=="MATRICULA ESCOLAR"
replace Q5_07_07= 1 if P5_8_9_C10=="stava estudar"
replace Q5_07_07= 1 if P5_8_9_C10=="TRABALHO DE FIM DO CURSO"
replace Q5_07_08= 1 if P5_8_9_C10=="FOI CHAMADO PELA REPARTIÇÃO"

replace Q5_07_10 = .
replace Q5_07_10 = 0 if inlist(Q5_07,1,2,3,4,5,8,10)
replace Q5_07_10= 1 if P5_8_9_C10=="atraso e chuma"
replace Q5_07_10= 1 if P5_8_9_C10=="Avaria do meio de transporte"
replace Q5_07_10= 1 if P5_8_9_C10=="CHUVA"
replace Q5_07_10= 1 if P5_8_9_C10=="chuvas"
replace Q5_07_10= 1 if P5_8_9_C10=="CHVAS CONSTANTES"
replace Q5_07_10= 1 if P5_8_9_C10=="falta de taxi"
replace Q5_07_10= 1 if P5_8_9_C10=="falta de transporte"
replace Q5_07_10= 1 if P5_8_9_C10=="MAL TEMPO"
replace Q5_07_10= 1 if P5_8_9_C10=="meio de transporte"
replace Q5_07_10= 1 if P5_8_9_C10=="MOTIVO DA CHUVA"
replace Q5_07_10= 1 if P5_8_9_C10=="por causa da chuva"
replace Q5_07_10= 1 if P5_8_9_C10=="por motivo de chuva"
replace Q5_07_10= 1 if P5_8_9_C10=="tranporte"
replace Q5_07_10= 1 if P5_8_9_C10=="Transporte"
replace Q5_07_10= 1 if P5_8_9_C10=="MAL CLIMA"

gen Q5_07_11 = 0 if inlist(Q5_07,1,2,3,4,5,8,10)
lab var Q5_07_11 "Missed days because of another personal reason"

replace Q5_07_11= 1 if P5_8_9_C10=="Renovaçao do bilhete de identidade"
replace Q5_07_11= 1 if P5_8_9_C10=="reuniao do seu filho"
replace Q5_07_11= 1 if P5_8_9_C10=="reuniao familiar"
replace Q5_07_11= 1 if P5_8_9_C10=="fui ao peso com o bebe"

order Q5_07_11, after(Q5_07_10)
lab val Q5_07_11 dummy

egen tot = rowtotal(Q5_07_01 Q5_07_02 Q5_07_03 Q5_07_04 Q5_07_05 Q5_07_06 Q5_07_07 Q5_07_08 Q5_07_09 Q5_07_10 Q5_07_11), missing
foreach var in Q5_07_01 Q5_07_02 Q5_07_03 Q5_07_04 Q5_07_05 Q5_07_06 Q5_07_07 Q5_07_08 Q5_07_09 Q5_07_10 Q5_07_11{
replace `var' = . if tot==0
}
drop tot

lab var P5_8_9_C10 "AUX"
drop P5_8_90_C10

lab var P5_8_90_C1_P5_8 "Number of days missed because of own sickness"
lab var P5_8_90_C2_P5_8 "Number of days missed because of sickness family member"
lab var P5_8_90_C3_P5_8 "Number of days missed because of death family member"
lab var P5_8_90_C4_P5_8 "Number of days missed because of other family emergency"
lab var P5_8_90_C5_P5_8 "Number of days missed because of picking up salary in the village center"
lab var P5_8_90_C6_P5_8 "Number of days missed to buy school supplies"
lab var P5_8_90_C7_P5_8 "Number of days missed because of a workshop/training"
lab var P5_8_90_C8_P5_8 "Number of days missed because of another reason related with the function"
lab var P5_8_90_C9_P5_8 "Number of days missed because of second job"
lab var P5_8_90_C10_P5_8 "Number of days missed because of unforseen circumstances such as rain"

rename P5_8_90_C(#)_P5_8 Q5_08_0(#)
rename P5_8_90_C(##)_P5_8 Q5_08_(##)

foreach var in Q5_08_01 Q5_08_02 Q5_08_03 Q5_08_04 Q5_08_05 Q5_08_06 Q5_08_07 Q5_08_08 Q5_08_09 Q5_08_10{
replace `var' = . if Q5_07==0
}

gen Q5_08_11 = Q5_08_10 if P5_8_9_C10=="Renovaçao do bilhete de identidade"
replace Q5_08_11 = Q5_08_10 if P5_8_9_C10=="reuniao do seu filho"
replace Q5_08_11 = Q5_08_10 if P5_8_9_C10=="reuniao familiar"
replace Q5_08_11 = Q5_08_10 if P5_8_9_C10=="fui ao peso com o bebe"
lab var Q5_08_11 "Number of days missed because of another personal reason"
order Q5_08_11, after(Q5_08_10)

replace Q5_08_01= 0 if P5_8_9_C10=="indisosta" & Q5_08_01==.
replace Q5_08_03= 0 if P5_8_9_C10=="MORTE DE FAMILIAR"& Q5_08_03==.
replace Q5_08_03= 0 if P5_8_9_C10=="esteve no obito"& Q5_08_03==.
replace Q5_08_03= 0 if P5_8_9_C10=="obito"& Q5_08_03==.
replace Q5_08_04= 0 if P5_8_9_C10=="problemas familias"& Q5_08_04==.
replace Q5_08_04= 0 if P5_8_9_C10=="PREOCUPAÇAO FAMILIAR"& Q5_08_04==.
replace Q5_08_07= 0 if P5_8_9_C10=="fez inscriçao na faculdade"& Q5_08_07==.
replace Q5_08_07= 0 if P5_8_9_C10=="MATRICULA ESCOLAR"& Q5_08_07==.
replace Q5_08_07= 0 if P5_8_9_C10=="stava estudar"& Q5_08_07==.
replace Q5_08_07= 0 if P5_8_9_C10=="TRABALHO DE FIM DO CURSO"& Q5_08_07==.
replace Q5_08_08= 0 if P5_8_9_C10=="FOI CHAMADO PELA REPARTIÇÃO"& Q5_08_08==.

replace Q5_08_01= Q5_08_01+Q5_08_10 if P5_8_9_C10=="indisosta"
replace Q5_08_03= Q5_08_03+Q5_08_10 if P5_8_9_C10=="MORTE DE FAMILIAR"
replace Q5_08_03= Q5_08_03+Q5_08_10 if P5_8_9_C10=="esteve no obito"
replace Q5_08_03= Q5_08_03+Q5_08_10 if P5_8_9_C10=="obito"
replace Q5_08_04= Q5_08_04+Q5_08_10 if P5_8_9_C10=="problemas familias"
replace Q5_08_04= Q5_08_04+Q5_08_10 if P5_8_9_C10=="PREOCUPAÇAO FAMILIAR"
replace Q5_08_07= Q5_08_07+Q5_08_10 if P5_8_9_C10=="fez inscriçao na faculdade"
replace Q5_08_07= Q5_08_07+Q5_08_10 if P5_8_9_C10=="MATRICULA ESCOLAR"
replace Q5_08_07= Q5_08_07+Q5_08_10 if P5_8_9_C10=="stava estudar"
replace Q5_08_07= Q5_08_07+Q5_08_10 if P5_8_9_C10=="TRABALHO DE FIM DO CURSO"
replace Q5_08_08= Q5_08_08+Q5_08_10 if P5_8_9_C10=="FOI CHAMADO PELA REPARTIÇÃO"

gen Q5_08_10x = .
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="atraso e chuma"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="Avaria do meio de transporte"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="CHUVA"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="chuvas"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="CHVAS CONSTANTES"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="falta de taxi"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="falta de transporte"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="MAL TEMPO"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="meio de transporte"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="MOTIVO DA CHUVA"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="por causa da chuva"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="por motivo de chuva"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="tranporte"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="Transporte"
replace Q5_08_10x = Q5_08_10 if P5_8_9_C10=="MAL CLIMA"
replace Q5_08_10 = Q5_08_10x
drop Q5_08_10x

forval n=1/9{
replace Q5_08_0`n' = . if Q5_07_0`n'!=1
}
replace Q5_08_10 = . if Q5_07_10!=1
replace Q5_08_11 = . if Q5_07_11!=1

order Q5_08_01 Q5_08_02 Q5_08_03 Q5_08_04 Q5_08_05 Q5_08_06 Q5_08_07 Q5_08_08 Q5_08_09 Q5_08_10 Q5_08_11, after(Q5_07_11)

lab var P5_8_90_C1_P5_9 "Absence approved in case of own sickness"
lab var P5_8_90_C2_P5_9 "Absence approved in case of sickness family member"
lab var P5_8_90_C3_P5_9 "Absence approved in case of death family member"
lab var P5_8_90_C4_P5_9 "Absence approved in case of other family emergency"
lab var P5_8_90_C5_P5_9 "Absence approved in case of picking up salary in the village center"
lab var P5_8_90_C6_P5_9 "Absence approved to buy school supplies"
lab var P5_8_90_C7_P5_9 "Absence approved in case of a workshop/training"
lab var P5_8_90_C8_P5_9 "Absence approved in case of another reason related with the function"
lab var P5_8_90_C9_P5_9 "Absence approved in case of second job"
lab var P5_8_90_C10_P5_9 "Absence approved in case of unforseen circumstances such as rain"

rename P5_8_90_C(#)_P5_9 Q5_09_0(#)
rename P5_8_90_C(##)_P5_9 Q5_09_(##)

foreach var in Q5_09_01 Q5_09_02 Q5_09_03 Q5_09_04 Q5_09_05 Q5_09_06 Q5_09_07 Q5_09_08 Q5_09_09 Q5_09_10{
replace `var' = . if Q5_07==0
recode `var' (2=0)
lab val `var' dummy
}

gen Q5_09_11 = Q5_09_10 if P5_8_9_C10=="Renovaçao do bilhete de identidade"
replace Q5_09_11 = Q5_09_10 if P5_8_9_C10=="reuniao do seu filho"
replace Q5_09_11 = Q5_09_10 if P5_8_9_C10=="reuniao familiar"
replace Q5_09_11 = Q5_09_10 if P5_8_9_C10=="fui ao peso com o bebe"
lab var Q5_09_11 "Absence approved in case of another personal reason"
order Q5_09_11, after(Q5_09_10)

replace Q5_09_01= Q5_09_10 if P5_8_9_C10=="indisosta" & Q5_09_01==.
replace Q5_09_03= Q5_09_10 if P5_8_9_C10=="MORTE DE FAMILIAR"& Q5_09_03==.
replace Q5_09_03= Q5_09_10 if P5_8_9_C10=="esteve no obito"& Q5_09_03==.
replace Q5_09_03= Q5_09_10 if P5_8_9_C10=="obito"& Q5_09_03==.
replace Q5_09_04= Q5_09_10 if P5_8_9_C10=="problemas familias"& Q5_09_04==.
replace Q5_09_04= Q5_09_10 if P5_8_9_C10=="PREOCUPAÇAO FAMILIAR"& Q5_09_04==.
replace Q5_09_07= Q5_09_10 if P5_8_9_C10=="fez inscriçao na faculdade"& Q5_09_07==.
replace Q5_09_07= Q5_09_10 if P5_8_9_C10=="MATRICULA ESCOLAR"& Q5_09_07==.
replace Q5_09_07= Q5_09_10 if P5_8_9_C10=="stava estudar"& Q5_09_07==.
replace Q5_09_07= Q5_09_10 if P5_8_9_C10=="TRABALHO DE FIM DO CURSO"& Q5_09_07==.
replace Q5_09_08= Q5_09_10 if P5_8_9_C10=="FOI CHAMADO PELA REPARTIÇÃO"& Q5_09_08==.

gen Q5_09_10x = .
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="atraso e chuma"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="Avaria do meio de transporte"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="CHUVA"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="chuvas"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="CHVAS CONSTANTES"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="falta de taxi"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="falta de transporte"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="MAL TEMPO"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="meio de transporte"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="MOTIVO DA CHUVA"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="por causa da chuva"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="por motivo de chuva"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="tranporte"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="Transporte"
replace Q5_09_10x = Q5_09_10 if P5_8_9_C10=="MAL CLIMA"
replace Q5_09_10 = Q5_09_10x
drop Q5_09_10x

lab var P5_10 "Did you miss school in May 2013?"
rename P5_10 Q5_10_a
recode Q5_10_a (2=0)
lab val Q5_10_a dummy
*people that did not remember opted for no since there was no option for "don't know"
*note that some of these people answered this question almost two years after May 2013

replace P5_10_P5_8 = . if Q5_10_a==0
rename P5_10_P5_8 Q5_10_b
lab var Q5_10_b "How many days did you miss school in May 2013?"

drop P5_11_120_C10

lab var P5_11_1201 "Missed days in May 2013 because of own sickness"
lab var P5_11_1202 "Missed days in May 2013 because of sickness family member"
lab var P5_11_1203 "Missed days in May 2013 because of death family member"
lab var P5_11_1204 "Missed days in May 2013 because of other family emergency"
lab var P5_11_1205 "Missed days in May 2013 because of picking up salary in the village center"
lab var P5_11_1206 "Missed days in May 2013 to buy school supplies"
lab var P5_11_1207 "Missed days in May 2013 because of a workshop/training"
lab var P5_11_1208 "Missed days in May 2013 because of another reason related with the function"
lab var P5_11_1209 "Missed days in May 2013 because of second job"
lab var P5_11_1210 "Missed days in May 2013 because of unforseen circumstances such as rain or transport"

rename P5_11_12(##) Q5_10_(##)

foreach var in Q5_10_01 Q5_10_02 Q5_10_03 Q5_10_04 Q5_10_05 Q5_10_06 Q5_10_07 Q5_10_08 Q5_10_09 Q5_10_10{
replace `var' = . if Q5_10_a==0
lab val `var' dummy
}
replace Q5_10_03 = 1 if P5_11_12_C10=="MORTE DO FAMILIAR"

replace Q5_10_10 = .
replace Q5_10_10 = 0 if Q5_10_a==1
replace Q5_10_10 = 1 if P5_11_12_C10=="AVARIA DA MOTORIZADA"
replace Q5_10_10 = 1 if P5_11_12_C10=="por causa da chuva"
replace Q5_10_10 = 1 if P5_11_12_C10=="por motivo de chuva"

gen Q5_10_11 = 0 if Q5_10_a==1
replace Q5_10_11 = 1 if P5_11_12_C10=="viagem"
lab var Q5_10_11 "Missed days in May 2013 because of another personal reason"
order Q5_10_11, after(Q5_10_10)
lab val Q5_10_11 dummy

egen tot = rowtotal(Q5_10_01 Q5_10_02 Q5_10_03 Q5_10_04 Q5_10_05 Q5_10_06 Q5_10_07 Q5_10_08 Q5_10_09 Q5_10_10 Q5_10_11), missing
foreach var in Q5_10_01 Q5_10_02 Q5_10_03 Q5_10_04 Q5_10_05 Q5_10_06 Q5_10_07 Q5_10_08 Q5_10_09 Q5_10_10 Q5_10_11{
replace `var' = . if tot==0
}
drop tot

lab var P5_11_12_C10 "AUX"

lab var P5_11_120_C1_P5_11 "Number of days missed in May 2013 because of own sickness"
lab var P5_11_120_C2_P5_11 "Number of days missed in May 2013 because of sickness family member"
lab var P5_11_120_C3_P5_11 "Number of days missed in May 2013 because of death family member"
lab var P5_11_120_C4_P5_11 "Number of days missed in May 2013 because of other family emergency"
lab var P5_11_120_C5_P5_11 "Number of days missed in May 2013 because of picking up salary in the village center"
lab var P5_11_120_C6_P5_11 "Number of days missed in May 2013 to buy school supplies"
lab var P5_11_120_C7_P5_11 "Number of days missed in May 2013 because of a workshop/training"
lab var P5_11_120_C8_P5_11 "Number of days missed in May 2013 because of another reason related with the function"
lab var P5_11_120_C9_P5_11 "Number of days missed in May 2013 because of second job"
lab var P5_11_120_C10_P5_11 "Number of days missed in May 2013 because of unforseen circumstances such as rain"

rename P5_11_120_C(#)_P5_11 Q5_11_0(#)
rename P5_11_120_C(##)_P5_11 Q5_11_(##)

foreach var in Q5_11_01 Q5_11_02 Q5_11_03 Q5_11_04 Q5_11_05 Q5_11_06 Q5_11_07 Q5_11_08 Q5_11_09 Q5_11_10{
replace `var' = . if Q5_10_a==0
}

replace Q5_11_03 = Q5_11_10 if P5_11_12_C10=="MORTE DO FAMILIAR"

gen Q5_11_11 = Q5_11_10 if P5_11_12_C10=="viagem"
lab var Q5_11_11 "Number of days missed in May 2013 because of another personal reason"
order Q5_11_11, after(Q5_11_10)
lab val Q5_11_11 dummy

gen Q5_11_10x = .
replace Q5_11_10x = Q5_11_10 if P5_11_12_C10=="AVARIA DA MOTORIZADA"
replace Q5_11_10x = Q5_11_10 if P5_11_12_C10=="por causa da chuva"
replace Q5_11_10x = Q5_11_10 if P5_11_12_C10=="por motivo de chuva"
replace Q5_11_10 = Q5_11_10x
drop Q5_11_10x

forval n=1/9{
replace Q5_11_0`n' = . if Q5_10_0`n'!=1
replace Q5_11_0`n' = . if Q5_11_0`n'==0
}
replace Q5_11_10 = . if Q5_10_10!=1
replace Q5_11_11 = . if Q5_10_11!=1

order Q5_11_01 Q5_11_02 Q5_11_03 Q5_11_04 Q5_11_05 Q5_11_06 Q5_11_07 Q5_11_08 Q5_11_09 Q5_11_10 Q5_11_11, after(Q5_10_11)

lab var P5_11_120_C1_P5_12 "Absence approved in May 2013 in case of own sickness"
lab var P5_11_120_C2_P5_12 "Absence approved in May 2013 in case of sickness family member"
lab var P5_11_120_C3_P5_12 "Absence approved in May 2013 in case of death family member"
lab var P5_11_120_C4_P5_12 "Absence approved in May 2013 in case of other family emergency"
lab var P5_11_120_C5_P5_12 "Absence approved in May 2013 in case of picking up salary in the village center"
lab var P5_11_120_C6_P5_12 "Absence approved in May 2013 to buy school supplies"
lab var P5_11_120_C7_P5_12 "Absence approved in May 2013 in case of a workshop/training"
lab var P5_11_120_C8_P5_12 "Absence approved in May 2013 in case of another reason related with the function"
lab var P5_11_120_C9_P5_12 "Absence approved in May 2013 in case of second job"
lab var P5_11_120_C10_P5_12 "Absence approved in May 2013 in case of unforseen circumstances such as rain"

rename P5_11_120_C(#)_P5_12 Q5_12_0(#)
rename P5_11_120_C(##)_P5_12 Q5_12_(##)

foreach var in Q5_12_01 Q5_12_02 Q5_12_03 Q5_12_04 Q5_12_05 Q5_12_06 Q5_12_07 Q5_12_08 Q5_12_09 Q5_12_10{
replace `var' = . if Q5_10_a==0
recode `var' (2=0)
lab val `var' dummy
}


replace Q5_12_03 = Q5_12_10 if P5_11_12_C10=="MORTE DO FAMILIAR"

gen Q5_12_11 = Q5_12_10 if P5_11_12_C10=="viagem"
lab var Q5_12_11 "Absence approved in May 2013 in case of another personal reason"
order Q5_12_11, after(Q5_12_10)
lab val Q5_12_11 dummy

gen Q5_12_10x = .
replace Q5_12_10x = Q5_12_10 if P5_11_12_C10=="AVARIA DA MOTORIZADA"
replace Q5_12_10x = Q5_12_10 if P5_11_12_C10=="por causa da chuva"
replace Q5_12_10x = Q5_12_10 if P5_11_12_C10=="por motivo de chuva"
replace Q5_12_10 = Q5_12_10x
drop Q5_12_10x

forval n=1/9{
replace Q5_12_0`n' = . if Q5_10_0`n'!=1
}
replace Q5_11_10 = . if Q5_10_10!=1
replace Q5_11_11 = . if Q5_10_11!=1

order P5_2_3_C11 P5_8_9_C10 P5_11_12_C10, after(Q5_12_11)
}
********************************************************************************
********************************** SECTION 6 ***********************************
********************************************************************************
{
lab var P9_1A "First most important accomplishment achieved by this school last year (2013)"
lab var P9_1B "Second most important accomplishment achieved by this school last year (2013)"
lab var P9_1C "Third most important accomplishment achieved by this school last year (2013)"

rename P9_1A Q6_01
rename P9_1B Q6_02
rename P9_1C Q6_03

lab var P9_1A_C80 "AUX"
lab var P9_1B_C81 "AUX"
lab var P9_1C_C82 "AUX"

lab var P6_4_27_P1_Q1 "Classes with too many students"
lab var P6_4_27_P2_Q1 "Quality of classrooms"
lab var P6_4_27_P3_Q1 "Sanitary installations"
lab var P6_4_27_P4_Q1 "Poor health of students"
lab var P6_4_27_P5_Q1 "Failure to comply with schedules by students"
lab var P6_4_27_P6_Q1 "Absences from students"
lab var P6_4_27_P7_Q1 "Dropout rate"
lab var P6_4_27_P8_Q1 "Disordered conduct or physical conflict among students"
lab var P6_4_27_P9_Q1 "Appreciation of students towards teachers"
lab var P6_4_27_P10_Q1 "Disrespect of students towards teachers"
lab var P6_4_27_P11_Q1 "Lack of parent involvement in school"
lab var P6_4_27_P12_Q1 "Insufficient number of teachers"
lab var P6_4_27_P13_Q1 "Preparation of school staff"
lab var P6_4_27_P14_Q1 "Absenteeism of teachers"
lab var P6_4_27_P15_Q1 "Teachers' failure to meet schedules"
lab var P6_4_27_P16_Q1 "Teacher salaries are too low"
lab var P6_4_27_P17_Q1 "Teacher evaluation"
lab var P6_4_27_P18_Q1 "Motivation of teachers"
lab var P6_4_27_P19_Q1 "The school budget is not enough"
lab var P6_4_27_P20_Q1 "Teachers give private lessons to students of their own class"
lab var P6_4_27_P21_Q1 "Teachers give private lessons to students in other classes"
lab var P6_4_27_P22_Q1 "Lack of teaching material"
lab var P6_4_27_P23_Q1 "Cost of guaranteeing materials for students"
lab var P6_4_27_P24_Q1 "Automatic passage of children to the next class, even without use"
lab var P6_4_27_P25_Q1 "Specific agenda items"
lab var P6_4_27_P26_Q1 "Extracurricular activities"
lab var P6_27 "AUX"

rename P6_4_27_P1_Q1 Q6_04
rename P6_4_27_P2_Q1 Q6_05
rename P6_4_27_P3_Q1 Q6_06
rename P6_4_27_P4_Q1 Q6_07
rename P6_4_27_P5_Q1 Q6_08
rename P6_4_27_P6_Q1 Q6_09
rename P6_4_27_P7_Q1 Q6_10
rename P6_4_27_P8_Q1 Q6_11
rename P6_4_27_P9_Q1 Q6_12
rename P6_4_27_P10_Q1 Q6_13
rename P6_4_27_P11_Q1 Q6_14
rename P6_4_27_P12_Q1 Q6_15
rename P6_4_27_P13_Q1 Q6_16
rename P6_4_27_P14_Q1 Q6_17
rename P6_4_27_P15_Q1 Q6_18
rename P6_4_27_P16_Q1 Q6_19
rename P6_4_27_P17_Q1 Q6_20
rename P6_4_27_P18_Q1 Q6_21
rename P6_4_27_P19_Q1 Q6_22
rename P6_4_27_P20_Q1 Q6_23
rename P6_4_27_P21_Q1 Q6_24
rename P6_4_27_P22_Q1 Q6_25
rename P6_4_27_P23_Q1 Q6_26
rename P6_4_27_P24_Q1 Q6_27
rename P6_4_27_P25_Q1 Q6_28
rename P6_4_27_P26_Q1 Q6_29

#delimit
lab def Q6_part1
1	"Build / improve classrooms"
2	"Build / improve sanitary facilities"
3	"Build / improve other facilities (eg multipurpose field, library, cafeteria ...)"
4	"Encourage extracurricular activities (for example: football championships between schools)"
5	"Improve the results achieved in the final exams"
6	"Improve student performance at all levels"
7	"Reducing the dropout rate"
8 	"Reduce teacher absenteeism"
9 	"Improve student assiduity"
10	"Improving teacher assiduity"
11	"Improving the conditions offered to teachers (salaries, accommodation near the school and / or ease of transportation)"
12	"Improving materials/furniture/teaching methods"
13	"Improving administration"
14	"More teachers"
15	"More students/classes"
16	"Interpersonal relations"
17	"Parental involvement"
;
lab def Q6_part2
0	"Not a problem"
1	"Small problem"
2	"Average problem"
3	"Big problem"
;
lab val Q6_01 Q6_02 Q6_03 Q6_part1;
lab val Q6_04 Q6_05 Q6_06 Q6_07 Q6_08 Q6_09 Q6_10 Q6_11 Q6_12 Q6_13 Q6_14 Q6_15 Q6_16 Q6_17 Q6_18 Q6_19 Q6_20 Q6_21 Q6_22 Q6_23 Q6_24 Q6_25 Q6_26 Q6_27 Q6_28 Q6_29 Q6_part2;
#delimit cr

replace Q6_01 = . if inlist(Q6_01,12,13)

replace Q6_01 = 1 if P9_1A_C80=="1 sala de umanova"
replace Q6_01 = 1 if P9_1A_C80=="as novas salas de aulas"
replace Q6_01 = 1 if P9_1A_C80=="CONSTRUÇAO DE 3 SALAS DE CHAPA ANEXAS"
replace Q6_01 = 1 if P9_1A_C80=="CONTRUÇAO DE 4 SALAAS"
replace Q6_01 = 1 if P9_1A_C80=="CONTRUÇAO DE NOVAS SALAS DE CHAPA"
replace Q6_01 = 1 if P9_1A_C80=="CONTRUÇAO DE Salas chapa"
replace Q6_01 = 1 if P9_1A_C80=="contruçao de salas anexas de chapa"
replace Q6_01 = 1 if P9_1A_C80=="contruçao de salas de chapas"
replace Q6_01 = 1 if P9_1A_C80=="desempenho dos alunos, a obra q estamos a construir"
replace Q6_01 = 1 if P9_1A_C80=="ESCOLA MAGICA"
replace Q6_01 = 1 if P9_1A_C80=="escola nova"
replace Q6_01 = 1 if P9_1A_C80=="levantamentos de duas salas de aulas"
replace Q6_01 = 1 if P9_1A_C80=="PINTOU-SE A ESCOLA"
replace Q6_01 = 1 if P9_1A_C80=="sala de chapa"
replace Q6_01 = 1 if P9_1A_C80=="TETO"
replace Q6_01 = 1 if P9_1A_C80=="teto novo"
replace Q6_01 = 1 if P9_1A_C80=="TURMAS ANEXAS"
replace Q6_01 = 2 if P9_1A_C80=="CONSTRUÇAO DE 2 CASAS DE BANHO"
replace Q6_01 = 2 if P9_1A_C80=="CONTRUÇAO DE CASAS DE BANHO"
replace Q6_01 = 3 if P9_1A_C80=="A sedencia do gabinete do subdireitor"
replace Q6_01 = 3 if P9_1A_C80=="ABASTECIMENTO DE AGUA POTAVEL"
replace Q6_01 = 3 if P9_1A_C80=="agua"
replace Q6_01 = 3 if P9_1A_C80=="agua canalizada"
replace Q6_01 = 3 if P9_1A_C80=="AGUA POTAVEL"
replace Q6_01 = 3 if P9_1A_C80=="canalizaçao da agua para os alunos"
replace Q6_01 = 3 if P9_1A_C80=="CONSTRUÇAO DO MURO DA ESCOLA"
replace Q6_01 = 3 if P9_1A_C80=="construçao de quintal"
replace Q6_01 = 3 if P9_1A_C80=="construçao do morro"
replace Q6_01 = 3 if P9_1A_C80=="construçao do muro da Escola"
replace Q6_01 = 3 if P9_1A_C80=="CONTRUÇÃO DO JARDIM E PLANTAÇ’ES DE PLANTAS"
replace Q6_01 = 3 if P9_1A_C80=="CONTRUÇAO DE TANQUE DE AGUA"
replace Q6_01 = 3 if P9_1A_C80=="CONTRUÇAO DO JANGO NA ESCOLA"
replace Q6_01 = 3 if P9_1A_C80=="escola comprou um bebedor de aga para os alunos"
replace Q6_01 = 3 if P9_1A_C80=="levantamento do borro"
replace Q6_01 = 3 if P9_1A_C80=="morro"
replace Q6_01 = 3 if P9_1A_C80=="muro"
replace Q6_01 = 3 if P9_1A_C80=="patio"
replace Q6_01 = 3 if P9_1A_C80=="pintura e vedaçao da escola"
replace Q6_01 = 3 if P9_1A_C80=="PLANTAÇAO DE ARVORES"
replace Q6_01 = 3 if P9_1A_C80=="PLANTACAO DE ARVORES"
replace Q6_01 = 3 if P9_1A_C80=="portao"
replace Q6_01 = 3 if P9_1A_C80=="quatros"
replace Q6_01 = 3 if P9_1A_C80=="quinta de chapa"
replace Q6_01 = 3 if P9_1A_C80=="REBOQUE"
replace Q6_01 = 4 if P9_1A_C80=="ACTIVIDADAES EXTRA ESCOLARES"
replace Q6_01 = 6 if P9_1A_C80=="rendimento escolar por parte dos alunos"
replace Q6_01 = 12 if P9_1A_C80=="a escola recebeu carteiras novas"
replace Q6_01 = 12 if P9_1A_C80=="A ESLOLA ANO PASSADO RECEBEU 3 QUADROS-"
replace Q6_01 = 12 if P9_1A_C80=="algumas carteiras novas"
replace Q6_01 = 12 if P9_1A_C80=="cadeiras"
replace Q6_01 = 12 if P9_1A_C80=="carteias"
replace Q6_01 = 12 if P9_1A_C80=="carteiras"
replace Q6_01 = 12 if P9_1A_C80=="carteiras novas"
replace Q6_01 = 12 if P9_1A_C80=="CARTEIRAS NOVAS CADEIRA E MANUAIS"
replace Q6_01 = 12 if P9_1A_C80=="CARTIRAS E SALA DO DIREITOR"
replace Q6_01 = 12 if P9_1A_C80=="COMPRA DE QUADROS NOVO"
replace Q6_01 = 12 if P9_1A_C80=="compramos filtro de agua"
replace Q6_01 = 12 if P9_1A_C80=="DERAM LIVROS APRA ESCOLA"
replace Q6_01 = 12 if P9_1A_C80=="DISTRIBUIÇAO DE MATERIAS DE ENSINO"
replace Q6_01 = 12 if P9_1A_C80=="DOAÇOES DE BENS MATERIAS"
replace Q6_01 = 12 if P9_1A_C80=="ENTREGA DE MATERIAS ESCOLARES"
replace Q6_01 = 12 if P9_1A_C80=="livros"
replace Q6_01 = 12 if P9_1A_C80=="material"
replace Q6_01 = 12 if P9_1A_C80=="material didaticos"
replace Q6_01 = 12 if P9_1A_C80=="MATERIAL ESCOLAR"
replace Q6_01 = 12 if P9_1A_C80=="MATERIAS"
replace Q6_01 = 12 if P9_1A_C80=="MATERIAS ESCOLAR"
replace Q6_01 = 12 if P9_1A_C80=="merenda escolar"
replace Q6_01 = 12 if P9_1A_C80=="MERENDAS ESCOLAR"
replace Q6_01 = 12 if P9_1A_C80=="novos quadros"
replace Q6_01 = 12 if P9_1A_C80=="quadro"
replace Q6_01 = 12 if P9_1A_C80=="quadros"
replace Q6_01 = 12 if P9_1A_C80=="QUADROS NOVO PINTURA SECRETARIAS"
replace Q6_01 = 12 if P9_1A_C80=="quadros novos"
replace Q6_01 = 12 if P9_1A_C80=="remudelamos as carteiras"
replace Q6_01 = 12 if P9_1A_C80=="secretarias"
replace Q6_01 = 12 if P9_1A_C80=="uma recadaçao dos materias"
replace Q6_01 = 15 if P9_1A_C80=="novos alunos"
replace Q6_01 = 16 if P9_1A_C80=="A interação que ouve entre a direção entre os professor"
replace Q6_01 = 16 if P9_1A_C80=="comemorajos o dia so educador"
replace Q6_01 = 16 if P9_1A_C80=="FESTA DO FIM DO ANO"
replace Q6_01 = 16 if P9_1A_C80=="O DIA DO EDUCADOR"
replace Q6_01 = 16 if P9_1A_C80=="Reuniões de conselho"
replace Q6_01 = 17 if P9_1A_C80=="participaçao do encarregados"

replace Q6_02 = . if inlist(Q6_02,12,13)
replace Q6_02 = 1 if P9_1B_C81=="FOI CIMENTADO"
replace Q6_02 = 1 if P9_1B_C81=="manuteçao das janelas"
replace Q6_02 = 1 if P9_1B_C81=="nova estrutura escolar"
replace Q6_02 = 1 if P9_1B_C81=="nova janelas"
replace Q6_02 = 1 if P9_1B_C81=="salas de chapas"
replace Q6_02 = 1 if P9_1B_C81=="TETO"
replace Q6_02 = 1 if P9_1B_C81=="uma sala de chapa"
replace Q6_02 = 3 if P9_1B_C81=="avedaçao da escola"
replace Q6_02 = 3 if P9_1B_C81=="CONSTRUÇAO DO JANGO"
replace Q6_02 = 3 if P9_1B_C81=="construçao do quintal da escol"
replace Q6_02 = 3 if P9_1B_C81=="CONTRUIÇAO DO MURO DA ESCOLA"
replace Q6_02 = 3 if P9_1B_C81=="jango"
replace Q6_02 = 3 if P9_1B_C81=="jardin"
replace Q6_02 = 3 if P9_1B_C81=="luiz"
replace Q6_02 = 3 if P9_1B_C81=="Melhoramento do pátio"
replace Q6_02 = 3 if P9_1B_C81=="um jardin"
replace Q6_02 = 12 if P9_1B_C81=="3 SECRETARIAS"
replace Q6_02 = 12 if P9_1B_C81=="a escola recebeu carteiras novas, armarios e quadros"
replace Q6_02 = 12 if P9_1B_C81=="a escola recebeu material didatico"
replace Q6_02 = 12 if P9_1B_C81=="ADQUIR MATERIAL DIDATICO QUADRO E CARTEIRAS"
replace Q6_02 = 12 if P9_1B_C81=="apagador"
replace Q6_02 = 12 if P9_1B_C81=="as carteiras"
replace Q6_02 = 12 if P9_1B_C81=="batas novas para os alunos"
replace Q6_02 = 12 if P9_1B_C81=="cadeiras"
replace Q6_02 = 12 if P9_1B_C81=="cadeiras novas"
replace Q6_02 = 12 if P9_1B_C81=="cardenetas"
replace Q6_02 = 12 if P9_1B_C81=="carteira"
replace Q6_02 = 12 if P9_1B_C81=="carteiras"
replace Q6_02 = 12 if P9_1B_C81=="carteiras novas"
replace Q6_02 = 12 if P9_1B_C81=="livros"
replace Q6_02 = 12 if P9_1B_C81=="manuais escolar"
replace Q6_02 = 12 if P9_1B_C81=="MATERIAIS DE ENSINO"
replace Q6_02 = 12 if P9_1B_C81=="material didatico"
replace Q6_02 = 12 if P9_1B_C81=="material escolar"
replace Q6_02 = 12 if P9_1B_C81=="materias didaticos"
replace Q6_02 = 12 if P9_1B_C81=="materias escolares"
replace Q6_02 = 12 if P9_1B_C81=="meios de ensino"
replace Q6_02 = 12 if P9_1B_C81=="meios de ensinos"
replace Q6_02 = 12 if P9_1B_C81=="mobiliarios"
replace Q6_02 = 12 if P9_1B_C81=="MUDANÇAS DOS MATERIAS ESCOLARES"
replace Q6_02 = 12 if P9_1B_C81=="pinturas"
replace Q6_02 = 12 if P9_1B_C81=="quadro de gigi"
replace Q6_02 = 12 if P9_1B_C81=="quadros"
replace Q6_02 = 12 if P9_1B_C81=="recebemos materias escolares"
replace Q6_02 = 12 if P9_1B_C81=="secretarias"
replace Q6_02 = 13 if P9_1B_C81=="ARQUIVOS"
replace Q6_02 = 13 if P9_1B_C81=="A organização dos processos individuas dos alunos"
replace Q6_02 = 17 if P9_1B_C81=="APROXIMACAO DOS INCARREGADOS"
replace Q6_02 = 17 if P9_1B_C81=="Colaboração dos pais e encarregados de educacao"

replace Q6_03 = . if inlist(Q6_03,12,13)
replace Q6_03 = 1 if P9_1C_C82=="pentura da escola"
replace Q6_03 = 3 if P9_1C_C82=="agua"
replace Q6_03 = 3 if P9_1C_C82=="aqua"
replace Q6_03 = 3 if P9_1C_C82=="campo"
replace Q6_03 = 3 if P9_1C_C82=="CONSTRUÇAO DO MURO DA ESCOLA"
replace Q6_03 = 3 if P9_1C_C82=="construçao do gabinete do subdiretor e um quarto paraarrecadação de material"
replace Q6_03 = 3 if P9_1C_C82=="construçao do quintal da Escola"
replace Q6_03 = 3 if P9_1C_C82=="MURARAM EM VOLTA A ESCOLA TODA"
replace Q6_03 = 3 if P9_1C_C82=="patio"
replace Q6_03 = 3 if P9_1C_C82=="PLANTAÇAO DE ARVOR"
replace Q6_03 = 4 if P9_1C_C82=="ACTIVIDADES EXTRA CURRICULARES"
replace Q6_03 = 9 if P9_1C_C82=="comportamento dos alunos"
replace Q6_03 = 12 if P9_1C_C82=="algumas muchilas"
replace Q6_03 = 12 if P9_1C_C82=="alguns material didatico"
replace Q6_03 = 12 if P9_1C_C82=="armario"
replace Q6_03 = 12 if P9_1C_C82=="armarios"
replace Q6_03 = 12 if P9_1C_C82=="carteira"
replace Q6_03 = 12 if P9_1C_C82=="CARTEIRAS"
replace Q6_03 = 12 if P9_1C_C82=="carteiras novas"
replace Q6_03 = 12 if P9_1C_C82=="e um pintura minima"
replace Q6_03 = 12 if P9_1C_C82=="jangos equadros"
replace Q6_03 = 12 if P9_1C_C82=="livros"
replace Q6_03 = 12 if P9_1C_C82=="manuais para os alunos"
replace Q6_03 = 12 if P9_1C_C82=="MATERIAIS DIDATICOS"
replace Q6_03 = 12 if P9_1C_C82=="material didatico"
replace Q6_03 = 12 if P9_1C_C82=="material escolar"
replace Q6_03 = 12 if P9_1C_C82=="novos materias qe recebemos"
replace Q6_03 = 12 if P9_1C_C82=="NOVOS VIDROS E CARTEIRA"
replace Q6_03 = 12 if P9_1C_C82=="os materiad novos que recebemos"
replace Q6_03 = 12 if P9_1C_C82=="partileiras"
replace Q6_03 = 12 if P9_1C_C82=="partilheira"
replace Q6_03 = 12 if P9_1C_C82=="quadros"
replace Q6_03 = 12 if P9_1C_C82=="um jango"
replace Q6_03 = 13 if P9_1C_C82=="organizaçao dos processos dos alunos"
replace Q6_03 = 16 if P9_1C_C82=="atividade conjunta entre alunos e professores para comemorar mais um aniversario da escola"
replace Q6_03 = 16 if P9_1C_C82=="os incontros que a direção tem realizado"
replace Q6_03 = 16 if P9_1C_C82=="VISITA AO LAR DOS IDOSOS"
replace Q6_03 = 17 if P9_1C_C82=="PARTICIPACAO DOS ENCARREGADOS DE EDUCACAO"

foreach var in Q6_04 Q6_05 Q6_06 Q6_07 Q6_08 Q6_09 Q6_10 Q6_11 Q6_12 Q6_13 Q6_14 Q6_15 Q6_16 Q6_17 Q6_18 Q6_19 Q6_20 Q6_21 Q6_22 Q6_23 Q6_24 Q6_25 Q6_26 Q6_27 Q6_28 Q6_29{
replace `var' = `var'-1
}

gen Q6_30 = .
replace Q6_30 = 1 if P6_27=="a desorganizaÇão estrutura das escola."
replace Q6_30 = 1 if P6_27=="As capelas devem ter carteiras"
replace Q6_30 = 1 if P6_27=="As janelas  n tem vidros"
replace Q6_30 = 1 if P6_27=="as portas .¥as casas de banho"
replace Q6_30 = 1 if P6_27=="Aumento de turmas e vedação do quintal"
replace Q6_30 = 1 if P6_27=="ausencia de sala de professores"
replace Q6_30 = 1 if P6_27=="condiçoes das escolas, auxencia dos alunos"
replace Q6_30 = 1 if P6_27=="Escola Nova,"
replace Q6_30 = 1 if P6_27=="Nova Escola,"
replace Q6_30 = 1 if P6_27=="pavilhoes multiuso"
replace Q6_30 = 1 if P6_27=="Pintura"
replace Q6_30 = 1 if P6_27=="Quintal e um campo desportivo"
replace Q6_30 = 1 if P6_27=="RESIDENCIA DOS PROFESSOR"
replace Q6_30 = 1 if P6_27=="Uma Nova construção   gabine , posto medico"
replace Q6_30 = 2 if P6_27=="aumento de salas de aulas"
replace Q6_30 = 2 if P6_27=="falta de salas"
replace Q6_30 = 2 if P6_27=="FALTA DE SALAS DE AULAS, VEDAR O MURO."
replace Q6_30 = 2 if P6_27=="falta de turmas"
replace Q6_30 = 2 if P6_27=="FALTAVDE SALAS DE AULAS, AREAS DE LASER"
replace Q6_30 = 2 if P6_27=="mais salas de aulas e atualizar as categoria dos professores em funçao da sua formação profisssional."
replace Q6_30 = 2 if P6_27=="o numero excessivo dos alunos"
replace Q6_30 = 2 if P6_27=="Reparação e mais salas de aulas"
replace Q6_30 = 2 if P6_27=="salas de aulas"
replace Q6_30 = 4 if P6_27=="Falta de meios de transpote"
replace Q6_30 = 4 if P6_27=="transporte, chuva"
replace Q6_30 = 5 if P6_27=="assalto na escola"
replace Q6_30 = 6 if P6_27=="MERENDA ESCOLAR, FALTA DE CORRENTE ELECTRICA"
replace Q6_30 = 7 if P6_27=="agua ecasa de banho"
replace Q6_30 = 7 if P6_27=="falta de agua"
replace Q6_30 = 7 if P6_27=="falta de agua na escola"
replace Q6_30 = 8 if P6_27=="falta de electricidade"
replace Q6_30 = 8 if P6_27=="iluminação"
replace Q6_30 = 9 if P6_27=="ligaçao entre professores e encarregados de educaçao"
replace Q6_30 = 9 if P6_27=="Nao participaçao dos encarregados"


order Q6_30 P9_1A_C80 P9_1B_C81 P9_1C_C82 P6_27, after(Q6_29)
lab var Q6_30 "Other problems that the respondent considers to be serious in school"

#delimit
lab def Q6_30
1	"Quality of other parts of the school building and/or in general"
2	"Not enough classrooms"
3	"Not enough teachers"
4	"Transportation to and from the school"
5	"No or not enough security"
6	"No or not enough school lunches"
7	"No or not enough water"
8	"No or not enough electricity/light"
9	"No or not enough involvement parents"
;
lab val Q6_30 Q6_30;
#delimit cr
}
********************************************************************************
********************************** SECTION 7 ***********************************
********************************************************************************
{
lab var P7_101 "(1) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var P7_102 "(2) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var P7_103 "(3) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"

rename P7_101 Q7_01
rename P7_102 Q7_02
rename P7_103 Q7_03

#delimit;
lab def Q7
1 "Purchase of school books."
2 "Construction/improvement of sanitary facilities."
3 "Increase in the number of classes for students (for example: during the afternoon)."
4 "School meals/snacks."
5 "Purchase/maintenance of furniture (eg desks, benches)."
6 "Extracurricular activities (eg football tournaments)."
7 "School projects (for example: multipurpose field)."
8 "Classroom building / improvement."
9 "Building/improving the library."
10 "Hiring more teachers."
11 "Increase teachers' salary by work day, to encourage attendance."
12 "Teacher training."
13 "School building/improvement in general"
14 "Lock the school yard"
15 "Construction/improvement of teachers' home/room"
16 "Light/electricity (generator)"
17 "Transportation for teachers/students"
18 "Contract security"
19 "Contract someone to clean"
20 "Water"
21 "Increase in the number of class grades at school"
;
lab val Q7_01 Q7_02 Q7_03 Q7;
#delimit cr

replace Q7_01 = . if inlist(Q7_01,13)
replace Q7_02 = . if inlist(Q7_02,13)
replace Q7_03 = . if inlist(Q7_03,13)

replace Q7_01 = 20 if P7_101_C13=="agua nos sanitarios"
replace Q7_01 = 20 if P7_101_C13=="CONSTRUÇAO DO TANQUE DE AGUA"
replace Q7_01 = 4 if P7_101_C13=="CANTINA ESCOLAR"
replace Q7_01 = 5 if P7_101_C13=="compra de ar condiionado"
replace Q7_01 = 5 if P7_101_C13=="COMPUTADOR"
replace Q7_01 = 5 if P7_101_C13=="maquina fotocopiadora"
replace Q7_01 = 7 if P7_101_C13=="campo"
replace Q7_01 = 7 if P7_101_C13=="campo de educaçao fisica"
replace Q7_01 = 7 if P7_101_C13=="escola com ginasio"
replace Q7_01 = 7 if P7_101_C13=="um campo"
replace Q7_01 = 7 if P7_101_C13=="um campo de futebol"
replace Q7_01 = 7 if P7_101_C13=="um patio para educaçao fisica"
replace Q7_01 = 7 if P7_101_C13=="centro de diagnostico"
replace Q7_01 = 8 if P7_101_C13=="as janelas"
replace Q7_01 = 8 if P7_101_C13=="COMPRA DE PORTAS"
replace Q7_01 = 8 if P7_101_C13=="conclui as salas de aulas novas"
replace Q7_01 = 8 if P7_101_C13=="construçao de mas salas de aulas"
replace Q7_01 = 13 if P7_101_C13=="construçao de uma nova escola"
replace Q7_01 = 13 if P7_101_C13=="construçao de uma nova estrutura"
replace Q7_01 = 13 if P7_101_C13=="CONTRUCAO DE ESCOLA"
replace Q7_01 = 13 if P7_101_C13=="contruçao do muro da escola"
replace Q7_01 = 13 if P7_101_C13=="ESTRUTURA"
replace Q7_01 = 13 if P7_101_C13=="EXTRUTURA"
replace Q7_01 = 13 if P7_101_C13=="levantamento do murro"
replace Q7_01 = 13 if P7_101_C13=="MATERIAL DE ENSINO"
replace Q7_01 = 13 if P7_101_C13=="melhora a estrutura da escola"
replace Q7_01 = 13 if P7_101_C13=="MELHORAR TETO"
replace Q7_01 = 13 if P7_101_C13=="MUDAR O TETO"
replace Q7_01 = 13 if P7_101_C13=="muro,pintura"
replace Q7_01 = 13 if P7_101_C13=="murro"
replace Q7_01 = 13 if P7_101_C13=="nova estrutura"
replace Q7_01 = 13 if P7_101_C13=="nova estrutura escolar"
replace Q7_01 = 13 if P7_101_C13=="Obras na escola"
replace Q7_01 = 13 if P7_101_C13=="pavimento"
replace Q7_01 = 13 if P7_101_C13=="pavimento da intistuiçao"
replace Q7_01 = 13 if P7_101_C13=="PINTURA"
replace Q7_01 = 13 if P7_101_C13=="pintura da escola"
replace Q7_01 = 13 if P7_101_C13=="pintura daescola"
replace Q7_01 = 13 if P7_101_C13=="reablitaçao da escola"
replace Q7_01 = 13 if P7_101_C13=="reablitar a escola"
replace Q7_01 = 13 if P7_101_C13=="reablitar a propia escola"
replace Q7_01 = 13 if P7_101_C13=="reparaçao da eecola"
replace Q7_01 = 13 if P7_101_C13=="reparaçao total"
replace Q7_01 = 13 if P7_101_C13=="TETO"
replace Q7_01 = 13 if P7_101_C13=="uma construçao definitiva"
replace Q7_01 = 13 if P7_101_C13=="uma escola de raiz"
replace Q7_01 = 13 if P7_101_C13=="uma estrutura de raiz"
replace Q7_01 = 13 if P7_101_C13=="uma estrutura nova"
replace Q7_01 = 13 if P7_101_C13=="uma extrutura da escola"
replace Q7_01 = 13 if P7_101_C13=="uma extrutura de raiz com 12 salas"
replace Q7_01 = 14 if P7_101_C13=="POR QUINTAL"
replace Q7_01 = 14 if P7_101_C13=="QUINTAL"
replace Q7_01 = 14 if P7_101_C13=="vedar a escola"
replace Q7_01 = 14 if P7_101_C13=="VEDAR O QUINTAL"
replace Q7_01 = 15 if P7_101_C13=="CASA DOS PROFESSORES"
replace Q7_01 = 15 if P7_101_C13=="CONSTRUIR UMA RESIDENCIA DOS PROFESSORES"
replace Q7_01 = 15 if P7_101_C13=="RESIDENCIA DOS PROFESSORES"
replace Q7_01 = 15 if P7_101_C13=="RESIDENCIA PARA OS PROFESSORES"
replace Q7_01 = 15 if P7_101_C13=="RESIDENCIA PARA PROFESSORES"
replace Q7_01 = 16 if P7_101_C13=="LUZ ELETRICA"
replace Q7_01 = 16 if P7_101_C13=="GERADOR"
replace Q7_01 = 17 if P7_101_C13=="transporte escolar"
replace Q7_01 = 19 if P7_101_C13=="Contratar um auxiliar de limpeza"
replace Q7_01 = 19 if P7_101_C13=="EMPREGADA DE LIMPESA"

replace Q7_02 = 20 if P7_102_C14=="AGUA POTAVEL"
replace Q7_02 = 20 if P7_102_C14=="CONTRUÇAO DE UM TAQUE DE AGUA"
replace Q7_02 = 20 if P7_102_C14=="TANQUE DE AGUA"
replace Q7_02 = 4 if P7_102_C14=="CANTINA ESCOLAR"
replace Q7_02 = 5 if P7_102_C14=="carteiras"
replace Q7_02 = 5 if P7_102_C14=="colocar carteiras em todas salas q não tem"
replace Q7_02 = 5 if P7_102_C14=="criar melhores condiçoes para os alunos: carteiras, salas ..."
replace Q7_02 = 5 if P7_102_C14=="Aquisição de equipamentode escritorio"
replace Q7_02 = 5 if P7_102_C14=="aumentar os materias em falta"
replace Q7_02 = 5 if P7_102_C14=="COMPRA DE VENTILADOR OU COMPRA DE AR CONDICIONADO"
replace Q7_02 = 5 if P7_102_C14=="condiçeos necessaria"
replace Q7_02 = 5 if P7_102_C14=="COPIADORA"
replace Q7_02 = 5 if P7_102_C14=="material da escola"
replace Q7_02 = 5 if P7_102_C14=="problema do material"
replace Q7_02 = 5 if P7_102_C14=="QUADROS"
replace Q7_02 = 6 if P7_102_C14=="ACTIVIDADES DESPIRTIVAS"
replace Q7_02 = 8 if P7_102_C14=="agua e luz"
replace Q7_02 = 8 if P7_102_C14=="as janelas"
replace Q7_02 = 8 if P7_102_C14=="COMPRA DE JANELAS"
replace Q7_02 = 8 if P7_102_C14=="ILUMINACAO"
replace Q7_02 = 8 if P7_102_C14=="JANELAS"
replace Q7_02 = 8 if P7_102_C14=="LUZ ELETRICA"
replace Q7_02 = 9 if P7_102_C14=="biblioteca"
replace Q7_02 = 8 if P7_102_C14=="aumento de sala de aulas"
replace Q7_02 = 8 if P7_102_C14=="aumento de salas"
replace Q7_02 = 8 if P7_102_C14=="quartos"
replace Q7_02 = 13 if P7_102_C14=="as fisuras da escola"
replace Q7_02 = 13 if P7_102_C14=="ASFALTAR A ENTRADA"
replace Q7_02 = 13 if P7_102_C14=="construir uma nova escola"
replace Q7_02 = 13 if P7_102_C14=="melhorar o aspecto da escola"
replace Q7_02 = 13 if P7_102_C14=="murro"
replace Q7_02 = 13 if P7_102_C14=="PINTURA"
replace Q7_02 = 13 if P7_102_C14=="por morro na escola"
replace Q7_02 = 13 if P7_102_C14=="reabilitar a escola"
replace Q7_02 = 13 if P7_102_C14=="reparaçao total da escola"
replace Q7_02 = 13 if P7_102_C14=="retira as salas de chapas"
replace Q7_02 = 14 if P7_102_C14=="PATIO"
replace Q7_02 = 14 if P7_102_C14=="patio da escola"
replace Q7_02 = 14 if P7_102_C14=="por quital"
replace Q7_02 = 14 if P7_102_C14=="quintal"
replace Q7_02 = 14 if P7_102_C14=="quital"
replace Q7_02 = 14 if P7_102_C14=="um quital de murro"
replace Q7_02 = 14 if P7_102_C14=="vedaçao do prpprio murro"
replace Q7_02 = 14 if P7_102_C14=="vedação do quintal"
replace Q7_02 = 14 if P7_102_C14=="VEDAR A ESCOLA"
replace Q7_02 = 15 if P7_102_C14=="CASA DOS PROFESSORES"
replace Q7_02 = 15 if P7_102_C14=="CASAS PARA PROFESSORES"
replace Q7_02 = 15 if P7_102_C14=="casas pra oe professores"
replace Q7_02 = 15 if P7_102_C14=="condiçoes para casa dos professores"
replace Q7_02 = 15 if P7_102_C14=="CONSTRUÇAO DE CASAS DOS PROFESSORES"
replace Q7_02 = 15 if P7_102_C14=="FALTA DE RESIDENCIA DOS PROFESSORES"
replace Q7_02 = 15 if P7_102_C14=="GABINET DO DIRECTOR"
replace Q7_02 = 15 if P7_102_C14=="gabinete"
replace Q7_02 = 15 if P7_102_C14=="salas dos professores"
replace Q7_02 = 15 if P7_102_C14=="um gabinete do director e uma sala dos professores"
replace Q7_02 = 15 if P7_102_C14=="uma sala dos professores"
replace Q7_02 = 15 if P7_102_C14=="APETRECHAR GABINE DOS PROFESSORES"
replace Q7_02 = 16 if P7_102_C14=="gerador"
replace Q7_02 = 16 if P7_102_C14=="placa raio solar pra dar aulas a noite"
replace Q7_02 = 17 if P7_102_C14=="MEIOS DE TRANSPORT PARA PROFESSORES"
replace Q7_02 = 17 if P7_102_C14=="TRANSPORTE ESCOLAR PARA OS PROFESSORES"
replace Q7_02 = 17 if P7_102_C14=="transporte para os professor"
replace Q7_02 = 18 if P7_102_C14=="segurança"

replace Q7_03 = 20 if P7_103_C15=="abastecimento de água"
replace Q7_03 = 2 if P7_103_C15=="casas de banhos"
replace Q7_03 = 2 if P7_103_C15=="saniamento basico"
replace Q7_03 = 2 if P7_103_C15=="tanque de agua"
replace Q7_03 = 5 if P7_103_C15=="as condiçoes de carteiras na sala de aulas"
replace Q7_03 = 5 if P7_103_C15=="carteiras"
replace Q7_03 = 5 if P7_103_C15=="COMPRA DE CARTEIRAS"
replace Q7_03 = 5 if P7_103_C15=="compra de quadros"
replace Q7_03 = 5 if P7_103_C15=="COMPRA DE QUADROS E CARTEIRA"
replace Q7_03 = 5 if P7_103_C15=="COMPRAR ALGUNS APARELHO DE VENTILAÇAO"
replace Q7_03 = 5 if P7_103_C15=="COMPUTADORES"
replace Q7_03 = 5 if P7_103_C15=="EQUIPAMENTOS DE EDUCAÇÃO FISICA"
replace Q7_03 = 5 if P7_103_C15=="GIZ"
replace Q7_03 = 5 if P7_103_C15=="mas apoio de materias"
replace Q7_03 = 5 if P7_103_C15=="mas carteiras"
replace Q7_03 = 5 if P7_103_C15=="MATERIAL DIDATICO"
replace Q7_03 = 7 if P7_103_C15=="campo"
replace Q7_03 = 7 if P7_103_C15=="um campo de desporto"
replace Q7_03 = 8 if P7_103_C15=="continas"
replace Q7_03 = 8 if P7_103_C15=="e apretexamento das salas"
replace Q7_03 = 8 if P7_103_C15=="mozaico ns salas de aulas"
replace Q7_03 = 8 if P7_103_C15=="PORTAO"
replace Q7_03 = 8 if P7_103_C15=="portoes"
replace Q7_03 = 8 if P7_103_C15=="construçao de novas salas"
replace Q7_03 = 8 if P7_103_C15=="construçao de uma sala de informatica"
replace Q7_03 = 10 if P7_103_C15=="aumento de professor"
replace Q7_03 = 12 if P7_103_C15=="formaçao permanente dos professores"
replace Q7_03 = 13 if P7_103_C15=="acabar com o morro"
replace Q7_03 = 13 if P7_103_C15=="contruçao de muro da escola"
replace Q7_03 = 13 if P7_103_C15=="contruçao do muro da escola"
replace Q7_03 = 13 if P7_103_C15=="melhorar as condiçoes de acesso a escola"
replace Q7_03 = 13 if P7_103_C15=="MUDAR TETO"
replace Q7_03 = 13 if P7_103_C15=="murro"
replace Q7_03 = 13 if P7_103_C15=="nova escola"
replace Q7_03 = 13 if P7_103_C15=="nova pintura e aumentar novas salas"
replace Q7_03 = 13 if P7_103_C15=="pintura"
replace Q7_03 = 13 if P7_103_C15=="reablitar a escola e merenda escolar"
replace Q7_03 = 13 if P7_103_C15=="reablitar ascasas dos professoes"
replace Q7_03 = 13 if P7_103_C15=="uma extrutura de raiz"
replace Q7_03 = 14 if P7_103_C15=="CONSTRUIR UM QUINTAL"
replace Q7_03 = 14 if P7_103_C15=="CONTRUÇAO DE UM QUINTAL NA ESCOLA"
replace Q7_03 = 14 if P7_103_C15=="contruçao do patio da escola"
replace Q7_03 = 14 if P7_103_C15=="FAZER UM QUINTAL PRA ESCOLA"
replace Q7_03 = 14 if P7_103_C15=="patio"
replace Q7_03 = 14 if P7_103_C15=="quintal"
replace Q7_03 = 14 if P7_103_C15=="veda o kintal"
replace Q7_03 = 14 if P7_103_C15=="vedar a escola"
replace Q7_03 = 14 if P7_103_C15=="vedar a escola com murro"
replace Q7_03 = 14 if P7_103_C15=="vsdar oo quital"
replace Q7_03 = 15 if P7_103_C15=="as residejcias dos prpfessores"
replace Q7_03 = 15 if P7_103_C15=="CASA DE PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="casa dos professores"
replace Q7_03 = 15 if P7_103_C15=="CASA PARA OS PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="CASA PARA PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="CONSTRUÇÃO DA SALA DO PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="CONSTRUÇÃO DE RESIDENCIA PARA OS PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="MELHORAMENTO DE CASAS DOS PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="REABILITAÇAO DA CASA DE PROFESSORES"
replace Q7_03 = 15 if P7_103_C15=="salas dos professores"
replace Q7_03 = 15 if P7_103_C15=="salas para os professores e para o director,e agua"
replace Q7_03 = 15 if P7_103_C15=="um patio e salas dos professores"
replace Q7_03 = 16 if P7_103_C15=="ILUMINACAO"
replace Q7_03 = 16 if P7_103_C15=="iluminaçao"
replace Q7_03 = 16 if P7_103_C15=="LUZ ELETRICA"
replace Q7_03 = 17 if P7_103_C15=="MEIOS DE TRANPORTE"
replace Q7_03 = 17 if P7_103_C15=="MEIOS DE TRANSPORTE PARA OS PROFESSORES"
replace Q7_03 = 17 if P7_103_C15=="na comprade um transporte escolar"
replace Q7_03 = 17 if P7_103_C15=="transporte para os professores"
replace Q7_03 = 17 if P7_103_C15=="COMPRA DE TRANSPORTE ESCOLAR"
replace Q7_03 = 18 if P7_103_C15=="CONTRATAR UM SEGURANÇA"
replace Q7_03 = 18 if P7_103_C15=="segurança"

lab var P7_101_C13 "AUX"
lab var P7_102_C14 "AUX"
lab var P7_103_C15 "AUX"

order P7_101_C13 P7_102_C14 P7_103_C15, after(Q7_03)
}
********************************************************************************
********************************** SECTION 8 ***********************************
********************************************************************************
{
#delimit ;
;
lab def agree
1	"Totally agree"
2	"Agree"
3	"Not agree nor disagree"
4	"Disagree"
5	"Totally disagree"
;
#delimit cr

lab var P8_1_4_P1_Q1 "The motivation of the teachers of this school is high"
lab var P8_1_4_P2_Q1 "Teachers work with enthusiasm"
lab var P8_1_4_P3_Q1 "Teachers are proud of this school"
lab var P8_1_4_P4_Q1 "Teachers value student achievement"

rename P8_1_4_P(#)_Q1 Q8_0(#)

forval n=1/4{
replace Q8_0`n' = . if Q8_0`n'==6
lab val Q8_0`n' agree
}

rename P8_61 Q8_06_01
rename P8_62 Q8_06_02

replace Q8_06_01 = . if Q8_06_01==4
replace Q8_06_02 = . if Q8_06_02==4

replace Q8_06_01 = 4 if P8_6_C4=="falta de meio de ensino"
replace Q8_06_01 = 4 if P8_6_C4=="Porque tudo q fizemos devemos depender do municipio"
replace Q8_06_01 = 4 if P8_6_C4=="Falta de apoio por falta do Miniserio"
replace Q8_06_01 = 4 if P8_6_C4=="fraca participação do encarregados em actividades extra escolar. e não velam pela estrutura da comunidade."
replace Q8_06_01 = 4 if P8_6_C4=="o director nao os tratam da mesma maneir"
replace Q8_06_01 = 4 if P8_6_C4=="Falta de merenda"
replace Q8_06_01 = 4 if P8_6_C4=="melhoramento da escola"
replace Q8_06_01 = 4 if P8_6_C4=="A ESCOLA NAO ESTA ORGANIZADA"

#delimit;
lab def Q8_06
1	"The principal has no qualifications to play the role"
2	"There are too many changes of school principal"
3	"There is a lack of interest of the school director in improving the performance of the school"
4	"Specific problems, not related to other options"
;
#delimit cr
lab val Q8_06_01 Q8_06_02 Q8_06

lab var Q8_06_01	"What is the first main reasons why you are dissatisfied with the way the school is managed?"
lab var Q8_06_02	"What is the second main reasons why you are dissatisfied with the way the school is managed?"
lab var P8_6_C4		"AUX"

lab var P8_5 "Overall, how satisfied are you with the way the school is managed?"
lab var P8_7 "Overall, how satisfied are you with your salary?"
lab var P8_8 "Overall, how satisfied are you with the choice in your professional career?"
lab var P8_9 "Overall, how satisfied are you with your school performance?"

rename P8_5 Q8_05
rename P8_7 Q8_07
rename P8_8 Q8_08
rename P8_9 Q8_09

lab val Q8_05 Q8_07 Q8_08 Q8_09 satisfied

lab var P8_101 "What is the first main reasons why you are dissatisfied with the performance of the school?"
lab var P8_102 "What is the second main reasons why you are dissatisfied with the performance of the school?"
lab var P8_10_C9 "AUX"

rename P8_101 Q8_10_01
rename P8_102 Q8_10_02

replace Q8_10_01 = . if Q8_10_01==9
replace Q8_10_02 = . if Q8_10_02==9
replace Q8_10_01 = 4 if P8_10_C9=="A forma em como o director se comporta"

#delimit;
lab def Q8_10
1 "Low salary"
2 "Poor performance of other teachers"
3 "Poor motivation of other teachers"
4 "Lack of interest of the school principal in it"
5 "Lack of support/commitment of parents/guardians in accompanying children"
6 "Low quality equipment in classrooms"
7 "Low quality infrastructure"
8 "Lack of school books"
;
#delimit cr
lab val Q8_10_01 Q8_10_02 Q8_10

order P8_6_C4 P8_10_C9, after(Q8_10_02)
}
********************************************************************************
********************************** SECTION 9 ***********************************
********************************************************************************
{
lab var P9_1 "Generally speaking, how often do you think school principals are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var P9_2 "Generally speaking, how often do you think school principals offer money or favors to be assigned to a specific school?"
lab var P9_3 "Generally speaking, how often do you think teachers are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var P9_4 "Generally speaking, how often do you think teachers offer money or favors to be assigned to a specific school?"

rename P9_(#) Q9_0(#)
forval n=1/4{
replace Q9_0`n' = . if Q9_0`n'==6
lab val Q9_0`n' freq
}
lab var Q9_05 "Would you be in favor of a school reform that would give the management the power to participate in the hiring and firing of the principal?"
recode Q9_05 (2=0)
lab val Q9_05 dummy

drop P9_61 P9_62 P9_63

lab var P9_6_C1 "First reason not in favor of the reform in Q12_5"
lab var P9_6_C2 "Second reason not in favor of the reform in Q12_5"
rename P9_6_C1 Q9_06_01
rename P9_6_C2 Q9_06_02

lab var Q9_07 "Would you be in favor of a school reform that would give the principal and teachers the power to participate in hiring and firing teachers?"
recode Q9_07 (2=0)
lab val Q9_07 dummy

drop P9_81 P9_82 P9_83
lab var P9_8_C1 "First reason not in favor of the reform in Q12_7"
lab var P9_8_C2 "Second reason not in favor of the reform in Q12_7"
rename P9_8_C1 Q9_08_01
rename P9_8_C2 Q9_08_02
}
********************************************************************************
********************************** SECTION 10 **********************************
********************************************************************************
{
lab var P10_1_2_P10_1_Q1 "Parents in my community still do not understand the benefits that education has in their children's lives"
lab var P10_1_2_P10_2_Q1 "There is a great advantage in sending my children to school, since education will help them to find a better job when they grow up"
rename P10_1_2_P10_1_Q1 Q10_01
rename P10_1_2_P10_2_Q1 Q10_02
replace Q10_01 = . if Q10_01==6
replace Q10_02 = . if Q10_02==6
lab val Q10_01 Q10_02 agree

lab var P10_3 "Do you think most people would try to be selfish if they had a chance or would they try to be fair?"
lab var P10_4 "Do you generally believe that people are trustworthy or think that 'all care is little'?"
rename P10_3 Q10_03
rename P10_4 Q10_04
replace Q10_03 = . if Q10_03==3
replace Q10_04 = . if Q10_04==3

#delimit;
lab def Q10_03
1 "They would try to be selfish"
2 "They would try to be fair"
;
lab def Q10_04
1 "They are trustworthy"
2 "'All care is little'"
;
#delimit cr
lab val Q10_03 Q10_03
lab val Q10_04 Q10_04

lab var P10_8 				"Do you disagree because the salary is too high or too low?"
rename P10_8 Q10_08
lab def Q10_08 1 "Too high" 2 "Too low"
lab val Q10_08 Q10_08

lab var P10_5_7_C1_Q1 "Teachers take their responsibilities to the students very seriously"
lab var P10_5_7_C2_Q1 "The better a child's education, the more success she will have when she reaches adulthood"
lab var P10_5_7_C3_Q1 "Teachers receive a fair wage for what they do"

lab var P10_9_14_C4_Q1 	"School principals take their responsibilities to the students very seriously"
lab var P10_9_14_C5_Q1 "The teachers are, in general, demoralized"
lab var P10_9_14_C6_Q1 "Teachers can not be criticized for giving explanations to their own students - they have to earn a living in some way"
lab var P10_9_14_C7_Q1 "Teachers can not be criticized for doing odd jobs out of school - they have to earn a living in some way"
lab var P10_9_14_C8_Q1 "Teachers can not be criticized for giving explanations to their own students because there are too few class hours and too many students to cover all the subjects in the program"
lab var P10_9_14_C9_Q1 "Parents/guardians can not be criticized for paying their children's explanations - they are concerned about the results achieved by their children"

rename P10_5_7_C1_Q1	Q10_05
rename P10_5_7_C2_Q1 	Q10_06
rename P10_5_7_C3_Q1	Q10_07

rename P10_9_14_C4_Q1 	Q10_09
rename P10_9_14_C5_Q1 	Q10_10
rename P10_9_14_C6_Q1 	Q10_11
rename P10_9_14_C7_Q1 	Q10_12
rename P10_9_14_C8_Q1 	Q10_13
rename P10_9_14_C9_Q1	Q10_14

foreach var in Q10_05 Q10_06 Q10_07 Q10_09 Q10_10 Q10_11 Q10_12 Q10_13 Q10_14{
replace `var' = . if `var'==6
lab val `var' agree
}
}
********************************************************************************
********************************** SECTION 11 **********************************
********************************************************************************
{
lab var P11_1 "Do you belong to any club, community-based organization, economic organization (such as kixikila groups), church or other social group in the community?"
lab var P11_2 "How many of these groups do you belong to?"

rename P11_1 Q11_01
recode Q11_01 (2=0)
lab val Q11_01 dummy

rename P11_2 Q11_02
replace Q11_02 = . if Q11_01!=1
replace Q11_02 = . if Q11_02==0
replace Q11_02 = 3 if Q11_02==4

forval n=3/10{
drop P11_3_`n'_P11_3_0
drop P11_3_`n'_P11_4
drop P11_3_`n'_P11_4_C13
drop P11_3_`n'_P11_5
drop P11_3_`n'_P11_6
drop P11_3_`n'_P11_7
drop P11_3_`n'_P11_7_C2
drop P11_3_`n'_P11_7_C6
drop P11_3_`n'_P11_8
drop P11_3_`n'_P11_9
drop P11_3_`n'_P11_10
drop P11_3_`n'_P11_11
drop P11_3_`n'_P11_11_C9
}

rename P11_3_0_P11_3_0 Q11_03_01
rename P11_3_1_P11_3_0 Q11_03_02
rename P11_3_2_P11_3_0 Q11_03_03
rename P11_3_0_P11_4 Q11_04_01
rename P11_3_1_P11_4 Q11_04_02
rename P11_3_2_P11_4 Q11_04_03
rename P11_3_0_P11_5 Q11_05_01
rename P11_3_1_P11_5 Q11_05_02
rename P11_3_2_P11_5 Q11_05_03
rename P11_3_0_P11_6 Q11_06_01
rename P11_3_1_P11_6 Q11_06_02
rename P11_3_2_P11_6 Q11_06_03
rename P11_3_0_P11_7 Q11_07_01
rename P11_3_1_P11_7 Q11_07_02
rename P11_3_2_P11_7 Q11_07_03
rename P11_3_0_P11_8 Q11_08_01
rename P11_3_1_P11_8 Q11_08_02
rename P11_3_2_P11_8 Q11_08_03
rename P11_3_0_P11_9 Q11_09_01
rename P11_3_1_P11_9 Q11_09_02
rename P11_3_2_P11_9 Q11_09_03
rename P11_3_0_P11_10 Q11_10_01
rename P11_3_1_P11_10 Q11_10_02
rename P11_3_2_P11_10 Q11_10_03
rename P11_3_0_P11_11 Q11_11_01
rename P11_3_1_P11_11 Q11_11_02
rename P11_3_2_P11_11 Q11_11_03

lab var Q11_03_01 "(1) What is the name of the organization?"
lab var Q11_03_02 "(2) What is the name of the organization?"
lab var Q11_03_03 "(3) What is the name of the organization?"

lab var Q11_04_01 "(1) What kind of group is the organization?"
lab var Q11_04_02 "(2) What kind of group is the organization?"
lab var Q11_04_03 "(3) What kind of group is the organization?"

lab var Q11_05_01 "(1) How many members does the organization have in this location?"
lab var Q11_05_02 "(2) How many members does the organization have in this location?"
lab var Q11_05_03 "(3) How many members does the organization have in this location?"

lab var Q11_06_01 "(1) Do you hold a leading position in this group?"
lab var Q11_06_02 "(2) Do you hold a leading position in this group?"
lab var Q11_06_03 "(3) Do you hold a leading position in this group?"

lab var Q11_07_01 "(1) Where is the organization located?"
lab var Q11_07_02 "(2) Where is the organization located?"
lab var Q11_07_03 "(3) Where is the organization located?"

lab var Q11_08_01 "(1) Are the members of the organization all of this commune?"
lab var Q11_08_02 "(2) Are the members of the organization all of this commune?"
lab var Q11_08_03 "(3) Are the members of the organization all of this commune?"

lab var Q11_09_01 "(1) Since when does this organization exist in the commune where it is located?"
lab var Q11_09_02 "(2) Since when does this organization exist in the commune where it is located?"
lab var Q11_09_03 "(3) Since when does this organization exist in the commune where it is located?"

lab var Q11_10_01 "(1) Since when do you belong to this group?"
lab var Q11_10_02 "(2) Since when do you belong to this group?"
lab var Q11_10_03 "(3) Since when do you belong to this group?"

lab var Q11_11_01 "(1) How often do you attend the meetings of the organization?"
lab var Q11_11_02 "(2) How often do you attend the meetings of the organization?"
lab var Q11_11_03 "(3) How often do you attend the meetings of the organization?"

lab var P11_3_0_P11_4_C13 "AUX"
lab var P11_3_1_P11_4_C13 "AUX"
lab var P11_3_2_P11_4_C13 "AUX"
lab var P11_3_0_P11_7_C2 "AUX"
lab var P11_3_1_P11_7_C2 "AUX"
lab var P11_3_2_P11_7_C2 "AUX"
lab var P11_3_0_P11_7_C6 "AUX"
lab var P11_3_1_P11_7_C6 "AUX"
lab var P11_3_2_P11_7_C6 "AUX"
lab var P11_3_0_P11_11_C9 "AUX"
lab var P11_3_1_P11_11_C9 "AUX"
lab var P11_3_2_P11_11_C9 "AUX"

#delimit
lab def Q11_04
1 "Association of farmers/fishermen"
2 "Association of merchants/traders"
3 "Professional association (eg doctors, teachers)"
4 "Chamber of Commerce"
5 "CACS communal/municipal"
6 "Religious group"
7 "Political movement"
8 "Cultural association"
9 "Sports Group."
10 "NGOs"
11 "Credit group (kixikila)"
12 "Group based on an ethnic community"
13 "Association based on a group of friends"
14 "Association based on a group of residents"
;
#delimit cr
lab val Q11_04_01 Q11_04_02 Q11_04_03 Q11_04

replace Q11_03_01 = "" if Q11_01!=1

replace Q11_04_03 = 14 if Q11_04_03==13

replace Q11_05_01 = . if Q11_01!=1
replace Q11_05_02 = . if Q11_01!=1 | Q11_02==1
replace Q11_05_03 = . if Q11_01!=1 | Q11_02==1 | Q11_02==2

foreach var in Q11_05_01 Q11_05_02 Q11_05_03{
replace `var' = . if `var' ==0
}

foreach var in Q11_06_01 Q11_06_02 Q11_06_03{
recode `var' (2=0)
lab val `var' dummy
}

#delimit
lab def Q11_07
1 "In this commune"
2 "In a nearby commune (specify)"
3 "In the capital of the municipality"
4 "Sumbe"
5 "Luanda"
6 "Other (specify)"
;
#delimit cr

rename P11_3_0_P11_7_C2 Q11_07_01_comuna
rename P11_3_0_P11_7_C6 Q11_07_01_other
rename P11_3_1_P11_7_C2 Q11_07_02_comuna
rename P11_3_1_P11_7_C6 Q11_07_02_other

lab var Q11_07_01_comuna "(1) Name of nearby comuna"
lab var Q11_07_01_other "(1) Name of other"
lab var Q11_07_02_comuna "(2) Name of nearby comuna"
lab var Q11_07_02_other "(2) Name of other"

lab val Q11_07_01 Q11_07_02 Q11_07_03 Q11_07

foreach var in Q11_08_01 Q11_08_02 Q11_08_03{
recode `var' (2=0)
lab val `var' dummy
}

*dates for Q11_09 and Q11_10

#delimit
lab def Q11_11
1 "Every day"
2 "More than once a week, but not every day"
3 "Once a week"
4 "Once a month"
5 "Once every two months"
6 "Once every three months"
7 "Once every six months"
8 "Once a year"
9 "Never"
;
#delimit cr

foreach var in Q11_11_01 Q11_11_02 Q11_11_03{
replace `var'=. if `var'==7
recode `var' (2=3) (3=4) (4=6) (5=7) (6=8)
lab val `var' Q11_11
}

replace Q11_11_01 = 2 if P11_3_0_P11_11_C9=="4 vezes por semana"

order Q11_07_01_comuna Q11_07_01_other, after(Q11_07_01)
order Q11_07_02_comuna Q11_07_02_other, after(Q11_07_02)

order P11_3_0_P11_4_C13 P11_3_1_P11_4_C13 P11_3_2_P11_4_C13 P11_3_2_P11_7_C2 P11_3_2_P11_7_C6 P11_3_0_P11_11_C9 P11_3_1_P11_11_C9 P11_3_2_P11_11_C9, after(Q11_11_03)
}
********************************************************************************
********************************** SECTION 12 **********************************
********************************************************************************
{
lab var P12_1_2_P12_1_Q1 	"Most people in this village/neighborhood are available to help if needed"
lab var P12_1_2_P12_2_Q1 	"In this village/neighborhood there are people who want to take advantage of others"
lab var P12_3 				"If you do not have a direct benefit from a community project, would you contribute time or money to this project?"
lab var P12_4 				"In the past year, did you or someone of your household attend a community activity where people came together to work for the community?"
lab var P12_5 				"If, for example, there is a water supply problem in your community, how likely are people to cooperate to solve the problem?"
lab var P12_6 				"In the last year, how often have people in this village/neighborhood come together to ask government officials or political leaders for some improvement in the community?"
lab var P12_7 				"How often do any of these differences divide your village / neighborhood? For example: differences in wealth, income, social status, ethnicity or ethno-linguistic past"
lab var P12_81 				"(1) What are the two differences that cause most often problems?"
lab var P12_82 				"(2) What are the two differences that cause most often problems?"
lab var P12_9 				"Voted in the 2012 general election"
lab var P12_10 				"Do you want to vote in the next elections?"
lab var P12_111 			"(1) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var P12_112 			"(2) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var P12_113 			"(3) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"

rename P12_1_2_P12_(#)_Q1 Q12_0(#)
rename P12_(#) Q12_0(#)
rename P12_81 Q12_08_01
rename P12_82 Q12_08_02
rename P12_10 Q12_10
rename P12_111 Q12_11_01
rename P12_112 Q12_11_02
rename P12_113 Q12_11_03

#delimit
lab def Q12_03
1 "Would only contribute time"
2 "Would only contribute money"
3 "Would contribute time and money"
4 "Neither would contribute time nor money"
;
lab def Q12_05
1 "Very likely"
2 "Likely"
3 "Neither likely nor unlikely"
4 "Unlikely"
5 "Very unlikely"
;
lab def Q12_06
1 "Never"
2 "Once"
3 "Sometimes (less than or equal to 5)"
4 "Often (more than 5)"
;
lab def Q12_07
1 "Very frequent"
2 "Frequent"
3 "Uncommon"
4 "Never"
;
lab def Q12_08
1 "Education"
2 "Land ownership"
3 "Wealth"
4 "Gender"
5 "Differences between new and old generations"
6 "Differences between old and new residents"
7 "Political party affiliation"
8 "Religion"
9 "Ethnic or linguistic past"
10 "Other more specific disputes"
;
lab def Q12_11
1 "Family, friends and neighbors"
2 "Local or community newspapers"
3 "Announcements on community placards"
4 "National newspaper"
5 "Radio"
6 "Television"
7 "Groups or associations"
8 "Business partners or co-workers"
9 "Community leaders"
10 "Government representatives"
11 "NGOs"
12 "Internet"
13 "Other"
;
#delimit cr

replace Q12_01 = . if Q12_01==6
replace Q12_02 = . if Q12_02==6
lab val Q12_01 Q12_02 agree

lab val Q12_03 Q12_03

recode Q12_04 (2=0)
lab val Q12_04 dummy
rename P12_4_C1 Q12_04_num
lab var Q12_04_num "How many times did you or someone of your household attend a community activity last year"

lab val Q12_05 Q12_05
lab val Q12_06 Q12_06
lab val Q12_07 Q12_07

replace Q12_08_01 = . if inlist(Q12_08_01,10,11,12)
replace Q12_08_02 = . if inlist(Q12_08_02,10,11,12)

replace Q12_08_01 = 10 if P12_8_C10=="lixo"
replace Q12_08_01 = 10 if P12_8_C10=="as nessecidades basicas"
replace Q12_08_01 = 10 if P12_8_C10=="agua"
replace Q12_08_01 = 10 if P12_8_C10=="a seca"
replace Q12_08_01 = 10 if P12_8_C10=="agua,terra"
replace Q12_08_01 = 10 if P12_8_C10=="chuva"
replace Q12_08_01 = 10 if P12_8_C10=="ANIMAIS SOLTOS"
replace Q12_08_01 = 10 if P12_8_C10=="FOFOCAS"
replace Q12_08_01 = 10 if P12_8_C10=="ma fe de algumas pessoas"
replace Q12_08_02 = 10 if P12_8_C10=="o desnivel de vida"
replace Q12_08_02 = 10 if P12_8_C10=="posto medico"
replace Q12_08_02 = 10 if P12_8_C10=="higene"
replace Q12_08_02 = 10 if P12_8_C10=="agua"
replace Q12_08_02 = 10 if P12_8_C10=="deliquencia"

lab val Q12_08_01 Q12_08_02 Q12_08

recode Q12_09 (2=0)
recode Q12_10 (2=0)
lab val Q12_09 Q12_10 dummy

lab val Q12_11_01 Q12_11_02 Q12_11_03 Q12_11
replace Q12_11_01 = 9 if P12_11_C13=="SOBA"

order P12_8_C10 P12_11_C13, after(Q12_11_03)
lab var P12_8_C10 "AUX"
lab var P12_11_C13 "AUX"
}
********************************************************************************
********************************** SECTION 13 **********************************
********************************************************************************
{
lab var P13_1_C1_Q1 "Book : does your household have any?"
lab var P13_1_C2_Q1 "Radio : does your household have any?"
lab var P13_1_C3_Q1 "Television : does your household have any?"
lab var P13_1_C4_Q1 "Computer : does your household have any?"
lab var P13_1_C5_Q1 "Internet : does your household have any?"
lab var P13_1_C6_Q1 "Digital camera : does your household have any?"
lab var P13_1_C7_Q1 "Mobile phone : does your household have any?"
lab var P13_1_C8_Q1 "Bicycle : does your household have any?"
lab var P13_1_C9_Q1 "Motorized : does your household have any?"
lab var P13_1_C10_Q1 "Carro : does your household have any?"
lab var P13_1_C11_Q1 "Oven : does your household have any?"
lab var P13_1_C12_Q1 "Washing machine : does your household have any?"
lab var P13_1_C13_Q1 "Fridge : does your household have any?"
lab var P13_1_C14_Q1 "Stove : does your household have any?"
lab var P13_1_C15_Q1 "Land [in hectares] : does your household have any?"
lab var P13_1_C16_Q1 "House : does your household have any?"
lab var P13_1_C17_Q1 "Farmed animals : does your household have any?"
lab var P13_1_C18_Q1 "Agricultural equipment (tractor) : does your household have any?"

lab var P13_1_C1_Q1_C1 "Book : how many are there in your household?"
lab var P13_1_C2_Q1_C1 "Radio : how many are there in your household?"
lab var P13_1_C3_Q1_C1 "Television : how many are there in your household?"
lab var P13_1_C4_Q1_C1 "Computer : how many are there in your household?"
lab var P13_1_C5_Q1_C1 "Internet : how many are there in your household?"
lab var P13_1_C6_Q1_C1 "Digital camera : how many are there in your household?"
lab var P13_1_C7_Q1_C1 "Mobile phone : how many are there in your household?"
lab var P13_1_C8_Q1_C1 "Bicycle : how many are there in your household?"
lab var P13_1_C9_Q1_C1 "Motorized : how many are there in your household?"
lab var P13_1_C10_Q1_C1 "Carro : how many are there in your household?"
lab var P13_1_C11_Q1_C1 "Oven : how many are there in your household?"
lab var P13_1_C12_Q1_C1 "Washing machine : how many are there in your household?"
lab var P13_1_C13_Q1_C1 "Fridge : how many are there in your household?"
lab var P13_1_C14_Q1_C1 "Stove : how many are there in your household?"
lab var P13_1_C15_Q1_C1 "Land [in hectares] : how many are there in your household?"
lab var P13_1_C16_Q1_C1 "House : how many are there in your household?"
lab var P13_1_C17_Q1_C1 "Farmed animals : how many are there in your household?"
lab var P13_1_C18_Q1_C1 "Agricultural equipment (tractor) : how many are there in your household?"

lab var P13_1_C1_Q2 "Book : total value"
lab var P13_1_C2_Q2 "Radio : total value"
lab var P13_1_C3_Q2 "Television : total value"
lab var P13_1_C4_Q2 "Computer : total value"
lab var P13_1_C5_Q2 "Internet : total value"
lab var P13_1_C6_Q2 "Digital camera : total value"
lab var P13_1_C7_Q2 "Mobile phone : total value : total value"
lab var P13_1_C8_Q2 "Bicycle : total value"
lab var P13_1_C9_Q2 "Motorized : total value"
lab var P13_1_C10_Q2 "Carro : total value"
lab var P13_1_C11_Q2 "Oven : total value"
lab var P13_1_C12_Q2 "Washing machine : total value"
lab var P13_1_C13_Q2 "Fridge : total value"
lab var P13_1_C14_Q2 "Stove : total value"
lab var P13_1_C15_Q2 "Land [in hectares] : total value"
lab var P13_1_C16_Q2 "House : total value"
lab var P13_1_C17_Q2 "Farmed animals : total value"
lab var P13_1_C18_Q2 "Agricultural equipment (tractor) : total value"

destring P13_1_C1_Q1_C1 P13_1_C2_Q1_C1 P13_1_C3_Q1_C1 P13_1_C4_Q1_C1 P13_1_C5_Q1_C1 P13_1_C6_Q1_C1 P13_1_C7_Q1_C1 P13_1_C8_Q1_C1 P13_1_C9_Q1_C1 P13_1_C10_Q1_C1 P13_1_C11_Q1_C1 P13_1_C12_Q1_C1 P13_1_C13_Q1_C1 P13_1_C14_Q1_C1 P13_1_C15_Q1_C1 P13_1_C16_Q1_C1 P13_1_C17_Q1_C1 P13_1_C18_Q1_C1, replace

foreach var in P13_1_C1_Q1 P13_1_C2_Q1 P13_1_C3_Q1 P13_1_C4_Q1 P13_1_C5_Q1 P13_1_C6_Q1 P13_1_C7_Q1 P13_1_C8_Q1 P13_1_C9_Q1 P13_1_C10_Q1 P13_1_C11_Q1 P13_1_C12_Q1 P13_1_C13_Q1 P13_1_C14_Q1 P13_1_C15_Q1 P13_1_C16_Q1 P13_1_C17_Q1 P13_1_C18_Q1{
recode `var' (2=0)
lab val `var' dummy
}

rename P13_1_C(#)_Q1 Q13_01_0(#)
rename P13_1_C(##)_Q1 Q13_01_(##)

rename P13_1_C(#)_Q1_C1 Q13_02_0(#)
rename P13_1_C(##)_Q1_C1 Q13_02_(##)

rename P13_1_C(#)_Q2 Q13_03_0(#)
rename P13_1_C(##)_Q2 Q13_03_(##)

replace Q13_02_07 = "4" if Q13_02_07=="4Y"
destring Q13_02_07, replace

replace Q13_02_17 = "" if Q13_02_17=="cabritos"
replace Q13_02_17 = "" if Q13_02_17=="cachorro"
replace Q13_02_17 = "" if Q13_02_17=="caes"
replace Q13_02_17 = "" if Q13_02_17=="cao"
replace Q13_02_17 = "" if Q13_02_17=="gados"
replace Q13_02_17 = "" if Q13_02_17=="galinhas"
replace Q13_02_17 = "" if Q13_02_17=="galinhas,patos"
replace Q13_02_17 = "" if Q13_02_17=="galinhas,patos,"
replace Q13_02_17 = "" if Q13_02_17=="um cao"
destring Q13_02_17, replace

replace Q13_02_18 = "" if Q13_02_18=="enxada,catana"
replace Q13_02_18 = "" if Q13_02_18=="exadas,catanas"
replace Q13_02_18 = "" if Q13_02_18=="exadas,catanas,machados"
destring Q13_02_18, replace

forval n=1/9{
replace Q13_01_0`n' = 0 if Q13_02_0`n'==0
replace Q13_02_0`n' = . if Q13_02_0`n'==0
replace Q13_03_0`n' = . if Q13_01_0`n'!=1
}

forval n=0/8{
replace Q13_01_1`n' = 0 if Q13_02_1`n'==0
replace Q13_02_1`n' = . if Q13_02_1`n'==0
replace Q13_03_1`n' = . if Q13_01_1`n'!=1
}

replace Q13_03_05=. if Q13_03_05==0
replace Q13_03_09=. if Q13_03_09==0
}


order school_id resp_idgame

rename P* TP*
rename Q* TQ*

rename resp_id 			T_resp_id
rename bairro_name 		T_bairro_name
rename time_start  		T_time_start
rename time_finish  	T_time_finish
rename school_name  	T_school_name
rename resp_name  		T_resp_name
rename resp_tel  		T_resp_tel
rename vil_id  			T_vil_id
rename commune_name  	T_commune_name
rename preschool 		T_preschool
rename grade1 			T_grade1
rename grade2 			T_grade2
rename grade3 			T_grade3
rename grade4 			T_grade4
rename grade5 			T_grade5
rename grade6 			T_grade6



**TDG

replace T_resp_tel = . if T_resp_name=="ana daconceiçao jesus"
drop if T_resp_tel == 928808566 & school_id==69

rename T_resp_tel TD_resp_tel

gen survey_type = 2

// Renaming variabels to append with directors

rename T_* *

drop resp_id school_name vil_id commune_name bairro_name

drop 	TP11_C13 TP19_C4 TP21_C6 TP2_1_C6 TP2_38 TP2_3_C8 TP2_8_C8 TP2_11_C7 ///
		TP2_12_C6 TP2_1610 TP2_1611 TP2_16_C10 TP2_17_C7 TP2_186 TP2_187 	///
		TP2_18_C6 TP2_195 TP2_196 TP2_19_C5 TP2_211 TP2_212 TP2_213 TP2_214 ///
		TP2_215 TP2_216 TP2_21_C4 TP2_239 TP2_23_C9 TP3_7_C6 TP3_9_C6 		///
		TP3_131_C5 TP3_134_C5 TP3_18_C5 TP4_8_C6 TP4_10_C5 TP5_2_3_C11 		///
		TP5_8_9_C10 TP5_11_12_C10 TP9_1A_C80 TP9_1B_C81 TP9_1C_C82 TP6_27 	///
		TP7_101_C13 TP7_102_C14 TP7_103_C15 TP8_6_C4 TP8_10_C9 				///
		TP11_3_0_P11_4_C13 TP11_3_1_P11_4_C13 TP11_3_2_P11_4_C13 			///
		TP11_3_2_P11_7_C2 TP11_3_2_P11_7_C6 TP11_3_0_P11_11_C9 				///
		TP11_3_1_P11_11_C9 TP11_3_2_P11_11_C9 TP12_8_C10 TP12_11_C13

rename TQ1_01 TDbase_age
rename TQ1_02 TDbase_female
rename TQ1_03 TDbase_home_loc2
rename TQ1_03_01 TDbase_home_loc2_other1
rename TQ1_03_02 TDbase_home_loc2_other2
rename TQ1_03_03 TDbase_home_loc2_other3
rename TQ1_04 TDbase_origin_muni
rename TQ1_05 TDbase_origin2
rename TQ1_05_01 TDbase_origin2_other1
rename TQ1_05_02 TDbase_origin2_other2
rename TQ1_05_03 TDbase_origin2_other3
rename TQ1_06 TDbase_leaving_origin
rename TQ1_07 TDbase_arriving_home
rename TQ1_08 TDbase_edu
rename TQ1_09 TDbase_marital
rename TQ1_10 TDbase_edu_partner
rename TQ1_11 TDbase_ocu_partner
rename TQ1_12 TDbase_income
rename TQ1_13 TDbase_children
rename TQ1_14 TDbase_children_others
rename TQ1_15 TDbase_children_girls
rename TQ1_16 TDbase_children_school
rename TQ1_17_01 TDbase_child1_grade
rename TQ1_17_02 TDbase_child2_grade
rename TQ1_17_03 TDbase_child3_grade
rename TQ1_17_04 TDbase_child4_grade
rename TQ1_17_05 TDbase_child5_grade
rename TQ1_17_06 TDbase_child6_grade
rename TQ1_17_07 TDbase_child7_grade
rename TQ1_17_08 TDbase_child8_grade
rename TQ1_18 TDbase_language
rename TQ1_19 TDbase_home_type
rename TQ1_20 TDbase_transport_distance
rename TQ1_21 TDbase_transport_type
rename TQ1_22 TDbase_transport_time
rename TQ2_01 Tbase_school_ocu
rename TQ2_02 Tbase_qualification
rename TQ2_03_01 TDbase_training_1
rename TQ2_03_02 TDbase_training_2
rename TQ2_03_03 TDbase_training_3
rename TQ2_03_04 TDbase_training_4
rename TQ2_03_05 TDbase_training_5
rename TQ2_03_06 TDbase_training_6
rename TQ2_03_07 TDbase_training_7
rename TQ2_04 Tbase_teach_other_school_years
rename TQ2_05 Tbase_name_other_school
rename TQ2_06 Tbase_loc1_other_school
rename TQ2_07 Tbase_loc2_other_school
rename TQ2_08 Tbase_transfer_reason
rename TQ2_09 Tbase_teach_this_school_years
rename TQ2_10 Tbase_help_nomination
rename TQ2_11 Tbase_help_nomination_type
rename TQ2_12 TDbase_stay
rename TQ2_13 TDbase_salary
rename TQ2_14 TDbase_bonus_possible
rename TQ2_15 TDbase_bonus_received
rename TQ2_16_01 TDbase_evaluation_how_1
rename TQ2_16_02 TDbase_evaluation_how_2
rename TQ2_16_03 TDbase_evaluation_how_3
rename TQ2_16_04 TDbase_evaluation_how_4
rename TQ2_16_05 TDbase_evaluation_how_5
rename TQ2_16_06 TDbase_evaluation_how_6
rename TQ2_16_07 TDbase_evaluation_how_7
rename TQ2_16_08 TDbase_evaluation_how_8
rename TQ2_16_09 TDbase_evaluation_how_9
rename TQ2_17 TDbase_evaluation_who
rename TQ2_18_01 Tbase_consequence_good_1
rename TQ2_18_02 Tbase_consequence_good_2
rename TQ2_18_03 Tbase_consequence_good_3
rename TQ2_18_04 Tbase_consequence_good_4
rename TQ2_18_05 Tbase_consequence_good_5
rename TQ2_18_06 Tbase_consequence_good_6
rename TQ2_19_01 Tbase_consequence_bad_1
rename TQ2_19_02 Tbase_consequence_bad_2
rename TQ2_19_03 Tbase_consequence_bad_3
rename TQ2_19_04 Tbase_consequence_bad_4
rename TQ2_19_05 Tbase_consequence_bad_5
rename TQ2_20 Tbase_dir_can_dismiss
rename TQ2_21 TDbase_receive_help
rename TQ2_22 TDbase_other_income
rename TQ2_23_01 Tbase_other_income_type1
rename TQ2_23_02 Tbase_other_income_type2
rename TQ2_23_03 Tbase_other_income_type3
rename TQ2_23_04 Tbase_other_income_type4
rename TQ2_23_05 Tbase_other_income_type5
rename TQ2_23_06 Tbase_other_income_type6
rename TQ2_23_07 Tbase_other_income_type7
rename TQ2_23_08 Tbase_other_income_type8
rename TQ2_24 TDbase_other_income_value

rename TQ3_* TD3base_*
rename TQ4_* TDbase_04_*
rename TQ5_* TD5base_*
rename TQ6_* TD7base_*
rename TQ7_* TD8base_*

rename TQ8_01 TDbase_teacher_motivation
rename TQ8_02 TDbase_teacher_enthusiasm
rename TQ8_03 TDbase_teacher_pride
rename TQ8_04 TDbase_teacher_studentresults
rename TQ8_05 TDbase_school_good_man
rename TQ8_06_01 TDbase_school_bad_man_reason1
rename TQ8_06_02 TDbase_school_bad_man_reason2
rename TQ8_07 TDbase_satis_salary
rename TQ8_08 TDbase_satis_career
rename TQ8_09 TDbase_school_good
rename TQ8_10_01 TDbase_school_bad_reason1
rename TQ8_10_02 TDbase_school_bad_reason2

rename TQ9_* TD10base_*
rename TQ10_* TD11base_*
rename TQ11_* TD12base_*
rename TQ12_* TD13base_*
rename TQ13_* TD14base_*

destring TDbase_04_12_02_money, replace
rename TDbase_04_12_02_gift TDbase_04_12_02_gift_specified
destring TD13base_04_num, replace

save "$Baseline_dtRaw/_intermediate files/baseline_teachers.dta", replace
